Hello World¶
My First Program (1)¶
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
$ gcc hello.c
$ ./a.out
hello, world
|
What we see …
|
My First Program (2)¶
#include <stdio.h>
|
|
int main(void)
|
|
{
printf("hello, world\n");
}
|
|
Character Arrays - Strings¶
Strings are special in C
Character: …
String: zero terminated character array
Escape sequences, e.g.
\n
(newline),\t
(tabulator),\"
,\0
(null)
The string "hello,world\n"
corresponds to …