Preprocessor Commands Functions Variables Statements Expressions Comments http
�������� • • • Preprocessor Commands Functions Variables Statements & Expressions Comments http: //siwanatsirilert 57170112. blogspot. com/2015/05/c-dennis-ritchie-c-bken-thomson-bcpl. html
Preprocessor Commands • ����������� source code ���� compile ���� • �������� • ������ # ������� preprocessor directives https: //www. codingunit. com/cplus-tutorial-
Preprocessor Commands https: //www. tutorialspoint. com/cprogrammi ng/c_preprocessors. htm http: //marcuscode. com/lang/cpp/preproces http: //www. cs. science. cmu. ac. th/person/areerat/204216/Lectur sor-directives e. Note/Compiler. Directive. pdf
Source file inclusion (#include) • #include �������� source program • ������ #include <filename> ���� #include “filename” • �������� (text file) #include <stdio. h> includes stdio. h include folder • < <������� �� from system. s ����� #include <iostream> includes cpp class library header iostream (C: TCINCLUDE) #include<my. cpp> includes my. cpp file from include folder #include “my. h” includes my. h file from current working folder • “” ������� �� directory ���� source #includes abc. h file from the myfolder which is available in “myfolder/abc. h” current working folder code https: //www. codingunit. com/cplus-tutorialpreprocessor-directives
Predefined Macros
Conditional inclusions (#ifdef, #ifndef, #if, #endif, #else and #elif) • ����������� macro directives ���������������������
Error directive (#error) • Error directive ��������� ��������� conditional directives ����������
�������� 1 http: //marcuscode. com/lang/
������� C • ����������� Net. CDF-C Libraries http: //www. unidata. ucar. edu/software/netcdf/doc
�������� (Variables) • ��������������� – ����� (local variable) – ������� (global variable) • ��������� https: //www. codecademy. com/en/forum_questions/53 a 6 b 2 c 48 c 1 ccc 0 d 3 d 0039 eb https: //www. codecademy. com/en/forum_questions/5149
Expression statements http: //www. cprogrammingexpert. com/C/Tutorial/fundamentals/e xpression_statement. aspx
Best IDEs for C/C++ Programming 1. Netbeans for C/C++ Development 2. Code: : Blocks 3. Eclipse CDT(C/C++ Development Tooling) 4. Code. Lite IDE 5. Bluefish Editor 6. Brackets Code Editor 8. Atom Code Editor 9. Sublime Text Editor 10. Jet. Brains CLion 11. Microsoft’s Visual Studio Code Editor 12. KDevelop 13. Geany IDE 14. Ajunta Deve. Studio 15. The GNAT Programming Studio 16. Qt Creator 17. Emacs Editor 18. VI/VIM Editor http: //www. tecmint. com/best-linux-ide-editors- http: //ccm. net/download/c-c-21
��������� for( i = 0; i<9 && winner==0; i++){ clrscr(); printf("nn"); clrscr(); printf("tt %c | %cn", board[0][0], printf("nn"); #include board[0][1], board[0][2]); printf("tt %c | %cn", board[0][0], board[0][1], "stdio. h" printf("tt---+---n"); board[0][2]); #include printf("tt %c | %cn", board[1][0], printf("tt---+---n"); board[1][1], board[1][2]); "conio. h" printf("tt %c | %cn", board[1][0], board[1][1], printf("tt---+---n"); printf("tt %c | %cn", board[2][0], board[1][2]); void main(){ board[2][1], board[2][2]); printf("tt---+---n"); if(winner == 0) int i = 0; printf("tt %c | %cn", board[2][0], board[2][1], printf("nttt. How boring, it is a drawn"); int player = board[2][2]); else player = i%2 + 1; 0; printf("ntt. Congratulations, player %d YOU ARE THE WINNER!n", winner); } int go = 0; int row = 0; do{ printf("ntt. Player %d, please enter the number [your] %c: ", player, (player==1)? 'X': 'O'); int column = scanf("%d", &go); 0; row = --go/3; int line = 0; column = go%3; int winner = }while(go<0 || go>9 || board[row][column]>'9'); board[row][column] = (player == 1) ? 'X' : 'O'; 0; char board[3][3] = if((board[0][0] == board[1][1] && board[0][0] == board[2][2]) || { (board[0][2] == board[1][1] && board[0][2] == {'1', '2', '3'}, board[2][0])) {'4', '5', '6'}, winner = player; {'7', '8', '9'} else http: //www. comscidev. com/howto/� http: //cpe-
- Slides: 34