
C
v_xchen_v
这个作者很懒,什么都没留下…
展开
-
declaration(声明)与definition(定义)
declaration(声明)与definition(定义) 声明:给变量定义一个数据类型和变量名 定义:给变量赋初值 c语言变量命名规则: Variable names in C are made up of letters (upper and lower case) and digits. The underscore character ("_") is also pe原创 2016-03-18 17:19:19 · 1618 阅读 · 0 评论 -
complicated declarations
函数指针 void (*p)(函数参数列表) = &函数; 返回值为int型指针的函数 int *p();原创 2016-03-18 17:37:20 · 330 阅读 · 0 评论 -
va_list va_start va_arg
摘自: http://www.cnblogs.com/hanyonglu/archive/2011/05/07/2039916.html typedef char* va_list; void va_start ( va_list ap, prev_param ); /* ANSI version */ type va_arg ( va_list ap, type ); v转载 2016-03-18 18:41:21 · 336 阅读 · 0 评论 -
Floating
x/y取余数 如果余数想要取浮点数的话,可以用fmod(x,y) float a = 3.14;a = a%3;float类型的值非法使用,%只能用于int型取余,float要用fmod() 3.14这种不带后缀符的含小数部分的实数默认为double型, 3.14f表示float类型的浮点字面值,3.14L表示double类型的浮点字面值。原创 2016-03-18 17:00:03 · 502 阅读 · 0 评论 -
String
scanf和gets 带输入的字符串比较复杂时,用gets,因为scanf()以Space、Enter、tab结束一次输入,gets以Enter结束输入(空格不结束) strcmp()比较两个字符串 Declaration: strcmp(const char *s1, const char*s2); The strcmp return an int value that原创 2016-03-18 18:00:11 · 358 阅读 · 0 评论