Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Slide 1: A bit of C programming | ||||||||
Line: 33 to 33 | ||||||||
“Hello World” program | ||||||||
Changed: | ||||||||
< < | #include <stdio.h> void main() { printf(“Hello World!\n”); } | |||||||
> > | ||||||||
Let us try to compile and execute this program | ||||||||
Line: 59 to 53 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Assignements | |||||||
> > | Assignments | |||||||
We modify the program to do some calculation:
| ||||||||
Added: | ||||||||
> > | Conditions: the if statementConditions can be tested with if if (a < b) printf(“a is bigger than b\n”); else printf(“b is bigger than a\n”); | |||||||
Calculating the Fibonacci numbersThe Fibonacci numbers: | ||||||||
Line: 108 to 116 | ||||||||
Pointer Example | ||||||||
Added: | ||||||||
> > | Command line argumentsThe main routine has 2 parameters, which we did not use yet as well as a return code. int main(int argc, char ** argv) or int main(int argv, char *argv[ ]); int argc is the number of arguments passed char **argv is a pointer to a list of null terminated C strings.Command line arguments example | |||||||
%SLIDESHOWEND% -- Uli Raich - 2017-09-07 | ||||||||
Line: 129 to 155 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|