摘要: 数组与指针 :数组在传递参数里,作用一样: array 都是一个指针,接收数组的首地址(int array[],int n ) ( int * array, int n )指针和数组可以等价转换array[i] *(array+i)二维数组传参 :(int a[][], int R , int C) 阅读全文
posted @ 2014-09-02 16:00 我爱背单词 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 验证大小端存储 :int main(){ int a = 0x12345678; char *p = (char *)&a; printf("%x\n", *p); // 78 表示这是小端存储 return 0;}字符数组:char name[] = { 'h', 'e', 'l', 'l', ' 阅读全文
posted @ 2014-09-02 15:30 我爱背单词 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 数组初始化:定义一个数组,不完全初始化,那么未初始化的值都为0定义一个数组,不初始化,里面全都是垃圾值让数组全部初始化0 可以 int a[500] = {0}; 数组初始化错误:int a[5] ;b = {1,2,3,4,5}//这样严重不可以,因为b是一个地址int b[5]= {1 , , 阅读全文
posted @ 2014-09-02 15:05 我爱背单词 阅读(167) 评论(0) 推荐(0) 编辑
摘要: %f,%lf 之间的区别float a;double b; scanf("%f",&a);//接受的时候 float 需要 f scanf("%lf",&a);//接受的时候 double 需要lffloat a;double b;printf("%f",a);打印的时候 float需要用fprin 阅读全文
posted @ 2014-09-02 14:55 我爱背单词 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 数据类型:long 32位4个字节 64位8个字节 vs2013 4个字节long long 8个字节float 4个字节double 8个字节%x和%p的区别:int main(){ int num = 256; printf("%p\n",&num); //0107FAFC printf("%# 阅读全文
posted @ 2014-09-02 14:52 我爱背单词 阅读(258) 评论(0) 推荐(0) 编辑