Introduction exercises on 31.8.2012
2012 - 2013
M.Sc Jussi Laakkonen (Room: 2517)
Exercises:
Additionally: two days (4.12.2011 & 5.12.2011) are reserved for Home examination demonstration.
Reception hour: Wednesday 1500 - 1600 (Room: 2517)
-std=gnu99
)<n>
is the assignment numberA1
, assignment 2 into A2
, etc.HE
directoryBefore starting any assignment, read the instruction section from course main pages:
http://www2.it.lut.fi/wiki/doku.php/courses/ct30a5000/start#instructions
See also additional documents, tutorials etc. from wiki pages:
http://www2.it.lut.fi/wiki/doku.php/courses/ct30a5000/start#documents_standards_tutorials
a - append (start editing) i - insert (start editing) esc - quit editing :w - save file :help - help :q - close help :wq - save and quit
man screen
)screen -S ScreenName ProgramToRun
screen -S EDITOR vim
screen -r EDITOR
man gcc
or go to gcc.gnu.orggcc helloworld.c -o helloworld
man make
all: gcc helloworld.c -o helloworld
make
gdb --args program arguments
man gdb
for quick info (try ddd
also, debugger with GUI)-g
switch when compiling with gcc
to enable debug symbolswhile(1) { /*code*/ }
man valgrind
valgrind ./helloworld
#include <stdlib.h> /* some code */ char *cpointer = (char *)malloc(sizeof(char));
When using these computers you must follow the rules set by university and department administrators.
See departmental information for students:
http://www2.it.lut.fi/wiki/doku.php/admin/studentinfo
See information about class 6218:
APPARENTLY YOU NEED TO HAVE AN “OLD” ACCOUNT (NO NUMBERS) TO ACCESS SSH.LUT.FI AS IT IS NOT MAINTAINED ANYMORE…
Connecting with ssh outside university:
If you have X-server running on your computer you can use graphical applications via ssh:
getaddrinfo()
carefully, for getting local IP addresses see also getifaddrs()
)Simple Hello World example including makefile.
OLD: helloworld.tar.gz
tar xzf helloworld.tar.gz
Simple UDP client and server example.
Unpack: udpexample2012.tar.gz
Simple TCP client and server example.
Unpack: tcpexample2012.tar.gz