Terminal
- Open
terminalafter pressing super key or using shortcutCTRL+ALT+T ls- list the files in the current directorypwd- List the path of the working directory/folder.mkdir <DIRNAME>- Creates a directory named<DIRNAME>cd <DIRNAME>- change directory to whatever specified in<DIRNAME>rmdir <DIRNAME>- removed the empty directory as specfied.date- system date/timeclear- clearman <CMD>- manual or help pages for all the commands.
Hello World Program
- Learn
Hello Worldprogram. - Learn to type and save
- Learn to compile and debug errors if any.
- Learn to execute or run the program.
Evaluations of expressions / datatypes
scanf and printf
functions
condition - if else
loop - while/do-while/for
File reading
Self learning
- gets is deprecated fgets(str, 100, stdin)
- terminal buffer
- variable length array vs malloc // stack vs host alloc
- variadic function
- Not to return char array
- there is no reference in c // only pointers
- the blow is a error in C/gcc. it is okay if you compile with gcc
swap(a,b);
void swap(int &a, int &b){
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}
- This is how we should do in c/gcc
swap(&a,&b)
void swap(int *a, int *b){
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}