Practical A

The aim of this practical is to get you working with GCC and an editor, and to introduce you to compiler-time errors and run-time errors.

If you are attending this course, change directory to Practical_A:
   cd Practical_A 
There you will find the source files for this practical. If you are accessing this material via The Web, you can download the examples by clicking on the links and copying-and-pasting the displayed programme into your favourite text editor.

Compile and run the following programmes:

  1. hello_world.c
    Investigate the error messages that GCC gives when:
    1. one instance of argc is changed to argd;
    2. a curly bracket (brace) is deleted.



  2. minimum.c

  3. gang.c
    After compiling and running this example as given delete one ampersand, & from the scanf line
            scanf("%f%d", &loot, &num_in_gang);
        
    compile and run again --- what happens?

    What happens if you enter '0' for 'gang size'? Add a few lines to the programme to "trap" this problem.


...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_course_crash_in_c/_reml_grp/index.reml
On: 3/3/2003 at 17:43:41
Options: reml2 -i noindex -l long -o html -p multiple