Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20161
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 44
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-19 12:18
个人简介

菜逼,别被fire了

文章分类

全部博文(4)

文章存档

2013年(4)

我的朋友

分类: C/C++

2013-04-28 18:13:58

A. programming fundamentals
    1. language translaters: assemblers\compiler\interpreter
    2. program developmeng: 
            create source code;
            proprecessing(attach .h file added to .c source file; constrant macro change, etc.);
            compile -> object code;
            linker : obj-code + obj-code of C library    -> executable file.
B. variables, arithmetic & expressions
    1. An arithmetic expression is NOT a complete C statement; but only a component of a statement;
    2. scanf needs '&' : scanf("%f%f", &a, &b);
    3. complete format for int & float:
            %[flag] [field-width] [.][precision] type (d/f/lf....)
    4.scientific notation: %15.4e
C. the basis of C-math Functions
    1. double(8), float(4), int(4); unsighed short int(2);
    2. input buffer: (FIFO) receive & store value;
    3. getchar() needs Enter to work, so an EXTRA '\n' will always be in the input buffer;
    4. so flush the input buffer: fflush(stdin);
    5. white-space is all the same to scanf
    6. white a file: fprintf(file_pointer, format_string,argument_list); -> fprintf(myfile, "%d",date);
                        file_pointer is a (FILE *) get by fopen -> myfile = fopen("ntc.cc" , "w");
D. begging decision making & looping
    1. it is NOT recommended to use '==' to compare double or float; 
    2. a good way is : if (fabs(a-b) < 10.e-10) {...}


==============TO BE CONTINUED==============
阅读(980) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~