I had a request for a deeper exploration of object file linking (during the compilation process). At the same time, I thought it would be a good opportunity to start looking at file processing (reading in data from a text file). I have implemented an example which will copy itself into your ~/src/cprog/scores/ directory; to get it, simply do the following (on lab46):
cd /var/public/cprog/multifile/scores/
make copy
cd ~/src/cprog/scores/
To compile (eventually we'll want to do this for EACH source file:
gcc -c main.c
gcc -c iscores.c
gcc -c fscores.c
gcc -c display.c
gcc -o scores main.o iscores.o fscores.o display.o (do this just once, after compiling each .c file to a .o file).
Warning Grades were submitted. You received one if you met one of these criteria:
(1F) No/shockingly little modification to your opus
(1D) Opus content/modifications, but far too little, or far too long since last update.
The situation is easy to fix, just keep your Opus updated and filled with relevant content. Some people in the class have an EXCELLENT Opus.
We're going to start exploring functions and multi-file programs. I have implemented an example which will copy itself into your ~/src/cprog/exponentiator/ directory; to get it, simply do the following (on lab46):
cd /var/public/cprog/multifile/exponentiator/
make copy
cd ~/src/cprog/exponentiator/
To compile (eventually we'll want to do this for EACH source file:
gcc -c main.c
gcc -o exponentiator *.o (do this just once, after compiling each .c file to a .o file).
Think of things you do not yet understand related to C– consider researching them or asking questions. And any such knowledge gained? Perfect for going on your journal!
Week 2
Try out address/content code
Find ranges and sizes for the following data types:
unsigned char
signed char
unsigned short int
signed short int
unsigned int
signed int
unsigned long int
signed long int
unsigned long long int
signed long long int
Example code for both the chars can be found here.
Week 1
Set up screen + irssi to get on the class chat.
Type in, compile, and study the Hello, World! example.
Set up Personal Lab46 Mercurial Repository
Type in, compile, and study the first data type example code.