Basic knowledge you should __allways__ keep in mind !!!

来源:互联网 发布:模型数据化 编辑:程序博客网 时间:2024/05/17 04:46

1).

int 声明的变量默认是带符号的,如果需要无符号整型,必须明确声明 unsigned int.

$ cat helloworld.c 
#include <stdio.h>
#include <stdlib.h>


int main(int argc, char *argv[])
{
int i = 2147483645;
int j = 2147483649;
printf("hello world ! %4d %4d\n", i,j);


return 0;
}
$ ./helloworld 
hello world ! 2147483645 -2147483647


函数中的数组参数

 

http://blog.sina.com.cn/s/blog_5365fc4d0100lvod.html


2).

以下代码的输出 ?

#include <stdio.h>#include <stdlib.h>#include <stdbool.h>int main(int argc, char* argv[]){bool fbUsed = 5;printf("fbUsed = %d \n", fbUsed);return 0;}


原创粉丝点击