How C# Differs From C
来源:互联网 发布:小鸟pt软件 编辑:程序博客网 时间:2024/05/20 22:00
programmer, you might be interested in the main differences between C# and C:
C#与C之间的主要区别是:
1. C# does not usually make use of pointers. You can only increment, or decrement a variable as if it were an actual memory pointer inside a special unsafe block.
C#不经常使用指针。你只能在特殊的非类型安全的代码段中,将一个变量作为一个实际的内存指针做increment和decrement操作。
2. You can declare variables anywhere inside a method you want to; they don’t have to be at the beginning of the method.
你可以在方法中的任何位置声明变量,不一定非得在函数的起始部分声明
3. You don’t have to declare an object before you use it; you can define it just as you need it.
你不必首先在使用之前声明一个对象,在用到的时候再声明
4. C# has a somewhat different definition of the struct types, and does not support the idea of a union at all.
C#在结构的定义上有一些不同,但是根本就不支持联合数据类型
5. C# has enumerated types, which allow a series of named values, such as colors or day names, to be assigned sequential numbers, but the syntax is rather different.
C#有枚举数据类型,可以存放已知的数据类型,如color或者day,但是语法相当不同
6. C# does not have bitfields: variables that take up less than a byte of storage.
C#没有bitfields(变量占据少于1个字节的数据类型)
7. C# does not allow variable length argument lists. You have to define a method for each number and type of argument. However C# allows for the last argument of a function to be a variable parameter array.
C#不支持获取变量字节长度的方法,你只能为每个方法成员或者数据类型定义类似Sizeof的函数,但是C#允许函数的最后一个参数为数组参数。
- How C# Differs From C
- How PowerShell Differs From the Windows Command Prompt
- C语言 ERROR C2040 ' ' differs in levels of indirection from ' '
- differs in levels of indirection from 'void
- How to make a callback to C# from C/C++ code
- How to make a callback to C# from C/C++ code
- How Data Center Services Market Differs in Geographic Regions: Gartner
- RzBorder.pas Number of elements differs from declaration TRzLEDCharacters
- E2072 Number of elements (18) differs from declaration (22)
- E2072 Number of elements (11) differs from declaration (15)
- How to get groups, users from Active Directory with C#
- How to read data from csv file in c#
- How to call an external C function from within Oracle
- How to Call Java functions from C Using JNI
- How to automate Microsoft Excel from Microsoft Visual C#.NET
- How do I call a C++ function from C?
- How to convert from int to string in objective c
- How to convert from int to string in objective c
- 在DOS下更改文件/文件夹的属性的方法
- .NET Framework 类库提供的命名空间
- Gentoo Linux 2005.0 Security Rebuild
- my first blog article
- 关于双硬盘安装后出现的盘符交错的问题
- How C# Differs From C
- Jek2k
- 邮箱签名图标 E-Mail Icon Generator
- 移动设备开发推荐网站
- 端口和CGI的扫描实现
- arp 欺骗的技术原理及应用
- 求记录中的最新数据的方法!
- GinaBackDoor简单实现
- 重装sqlserver