C-programming
autumn 2010
Exercise 1
9.9 9:00-12:00 B119.
- Write into a file
"Hello, world" program, compile and make a runnable program. Run the program.
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
- In lecture notes there is a situation, where a program consists of
modules (eka, toka, main etc.) Write codes in to files and compile them and make a
runnable program from object files. Write also a makefile that does the same and try to use it.
- What the following codes of C do?
a)while (*q++ = *p++);
b)if ((c=fgetc(fileHandle)) == EOF)
c)for (i=a, j=b; i<=j; i += 2, j += 2)
- What advantages/disadvantages you can list if the garbage collection
is missing from programming language.
- Inspect the sample program
sample.c.
from course book.
List those points,
that are unclear for you. (You understand better, if you read chapter 2.)
Study also
- Compiling, linking and running programs in Linux environment
- Evaluation order
.