中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > 综合其它
How C# Differs From C
作者:未知 时间:2005-07-27 23:10 出处:CSDN 责编:chinaitpower
              摘要:How C# Differs From C
If you have been exposed to C, or if you are an experienced C
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#允许函数的最后一个参数为数组参数。


关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有