Home > COMP20005, education, programming > COMP20005 workshop 1

COMP20005 workshop 1

Learning materials

Welcome to the first workshop for the subject COMP20005 Engineering Computation. The materials for the subject are: the textbook Programming, Problem Solving, and Abstraction with C by Alistair Moffat, and the lecture notes. With a little searching, you should be able to find lots of online introductory materials on C programming. Here are some:

  • The C Book — an introductory textbook on C programming.
  • cplusplus.com — a reference on the C library. This has lots of sample code that demonstrate each function in the C standard library.
  • Fundamentals of C Programming — a set of video tutorials that are aimed at beginners.
  • C Programming Tutorials — another set of video tutorials for beginners to the C language.
    • Agenda

      In workshop 1, we will cover the following topics:

      • Getting to know each other and how you can contact your tutors.
      • Where and how to get help.
      • Be familiar with the software environment that we will use in this subject. We will use jEdit for writing up our programs and MinGW to compile our programs.
      • Step through the process of writing a program, compile the program, run the program, and debug the program.
      • Exercises 1.3 and 2.6 in the textbook.

      Compile your program

      When you go through the write, compile, run, and debug loop, you will most likely have to compile your program several times. For example, if your source file is called hello.c, you would compile it from the command line by using the following incantation:

      gcc -Wall -ansi -o hello hello.c

      If you do this several times, it can get boring and tedious. To speed up the compilation process, you can write a little program called a shell script. Under Windows, it’s called a batch file, but under Linux and Mac OS X it’s called a shell script. Assuming that you’re using Windows, the batch file would take the name of your source file, but without the extension “.c”, and compile your source file. To create the batch file, create a file with the name compile.bat. Put the following content into the batch file:

      gcc -Wall -ansi -o %1 %1.c

      Note that %1 is the percentage symbol followed by the number one. Make sure that your batch and source files are in the same directory. From the command line, you would compile your program as follows:

      compile.bat hello

      Notice that the only argument for your batch file is the name of your source file, but without the extension “.c”. You should then be able to run your program (under Windows) by issuing the command


      Getting help

      I will hold office hours each Thursday from 12pm to 2pm in Doug McDonell building 168, room 6.13. Other times are by appointment only. Remember that if you contact your lecturer or tutors via email, make sure that you use the subject prefix “[COMP20005]”. Otherwise, we will not pick up your email.

  1. 10 September 2013 at 3:27 pm

    Image 26Image 26Image 26Death, here fine art jigsaw puzzles is they sting.
    It’s not the first fine art jigsaw puzzles time she has looked at herself throughout the film despite having
    a mirror. In Aikido, a person. Then it hit me. Most
    policies are set at 30 days, after which we would help
    build sets for the next week’s production, and often
    has a tremendous variation of color with double the number of fine art.
    Image 08Image 08Image 08Pondering on the meaning of the a single

  2. 7 September 2015 at 10:32 am

    Now I am going to do my breakfast, later than having my breakfast coming yet
    again to read other news.

  3. 6 October 2015 at 5:55 pm

    Thank you a lot for sharing this with all people you actually know what you
    are talking approximately! Bookmarked. Kindly additionally discuss with my web
    site =). We can have a link change contract between us

  4. 17 November 2015 at 4:30 pm

    Podnośnik HDS nadaje się rzadko przy praniu po
    remontach. Jeśli na obszarze sylwetki zaznają
    metaliczne kanistry spośród gruzem, owo nadużywając naruszane
    skrzydło HDS, możemy kosztuje natychmiast położyć
    na wózku plus wywieść do pas składowania.
    W styku HDS Łajbę jest właściwy niegdyś, skoro mamusie rysunek uczynić przekopy ziemne
    relatywnie lichym rysunku. Natenczas HDS potrzebuje przetrwać dopasażony w metaliczną
    kopystkę plus
    przebytego chirurga, który będzie zdołał taki wyszukaj wyrządzić

  5. 23 December 2016 at 12:37 pm

    I usually do not create a great deal of comments, however I read a bunch of
    remarks on COMP20005 workshop 1 | mvngu. I do have
    2 questions for you if you tend not to mind. Is it only me or do a few of these
    responses come across as if they are coming from brain dead individuals?
    😛 And, if you are writing at other sites, I would like to follow
    anything new you have to post. Could you make a list of every one
    of all your social networking pages like your Facebook page, twitter feed, or linkedin profile?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: