随笔分类 - c
摘要:2.1 变量名变量名由字母和数字组成,第一个字符必须是字母,下划线 "_" 也算是一个字母,变量名是严格区分大小写的,除了常用的关键字,如 if else while int float ... 其他的都能用。 变量的命名很重要,基本遵循功能驱动的方式,简洁、带有说明的英文单词,c好像喜欢用小写及英文单词的缩写来命名,可以借鉴。2.2 数据类型char 字符串 int 整型 float 浮点型 double 双精度型 。2个限定符 unsigned 非负数 signed 实数 ,如果是32位的计算机,chars 含有8个bits , unsigned chars 的范围是
阅读全文
摘要:Exercise 1-1. Run the ``hello, world'' program on your system. Experiment with leavingout parts of the program, to see what error messages you get.Exercise 1-2. Experiment to find out what happens when prints's argument string contains\c, where c is some character not listed above.Exerci
阅读全文
摘要:因为想要成为高级PHPER,所以开始认真学习C语言,我看的书名为 C K&R.pdf。这系列文章将作为读书笔记及心得不定时的发布到博客上。The first c program这是摄氏与华氏温度转换的公式:C=(5/9)(F-32) 1 /* 引入库文件 */ 2 #include <stdio.h> 3 #include <stdlib.h> 4 /* 入口函数 */ 5 main() 6 { 7 /* 定义变量 */ 8 int fahr, celsius; 9 int lower, upper, step;10 11 /* 初始化变量的值 *...
阅读全文
摘要:#include int main(){ printf("hello, world\n");}跟随helloworld.c的脚步,来一次操作系统的短暂地观光之旅。这条语句可能被无数地程序员写过,其内在就是一连串地010110...bits 序列, 它们8个一起构成bytes,每一个bytes代...
阅读全文
浙公网安备 33010602011771号