摘要: 《c专家编程》区别1:#define peach intusigned peach i; /*正确*/typedef int banana;unsigned banana i; /*错误*/区别2:#define int_ptr int *int_ptr chalk, cheese;宏扩展后相当于int * chalk,cheese;typedef int * int_ptr;int_ptr chalk, cheese;则表示int *chalk,*cheese;用typedef定义的类型能够保证声明中的变量为同一类型! 阅读全文
posted @ 2012-12-14 20:44 helloweworld 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 下面定义是对的:const int *a;int *const b; //b指向不可改int const *c; //c指向的变量的值不可改下面定义错误!const *int e;const在*的左边则指向的变量值只读,const在*的右边则指针指向只读,即“左定值,右定向”!注意:左定值右定向的参照物是* !!! 阅读全文
posted @ 2012-12-14 20:27 helloweworld 阅读(161) 评论(0) 推荐(0) 编辑