CCPlusPlus2011: Difference between revisions

From Sccswiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
The compact course on C/C++ takes place at the t.b.a. from June 27, 2011, to July 8, 2011. It is tailored to Ph.D. students and PostDocs.
The compact course on C/C++ takes place at the MPE from June 27, 2011, to July 8, 2011. It is tailored to Ph.D. students from the IMPRS. Lectures start at 9:30 s.t. and last for approximately 3 hours a 45 minutes, i.e. the course will finish around 12:15.


== Lecture Notes ==
== Lecture Notes ==


* Monday, June 27: t.b.d.
* Monday, June 27: Introduction, Variables, and Identifiers
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/01-introduction-mpg.pdf Introduction]
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/02-variables.pdf Variables and Identifiers]
* Tuesday, June 28: Control Structures
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/03-control-structures.pdf Slides]
* Wednesday, June 29: Functions
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/04-functions.pdf Slides]
* Thursday, June 30: Applicative Programming (and basic programming engineering)
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/05-applicative-programming.pdf Slides]
* Friday, July 1: Pointers, Structs, and Arrays
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/06-arrays.pdf Slides]
* Monday, July 4: Pointers, Structs, and Arrays - Continued
* Tuesday, July 5: Object-based Programming
** Different room: Room 209 (Alter Seminarraum)
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/08-object-based-programming.pdf Slides]
* Wednesday, July 6: From Object-based Programming to Object-oriented Programming
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/10-object-oriented-programming.pdf Slides]
* Thursday, July 7: Object-oriented Programming - Continued
* Friday, July 8: Generic Programming and Wrap-up
** [http://www5.in.tum.de/lehre/vorlesungen/progcourse/c/11-generic-programming-and-patterns.pdf Slides]
 




== Requirements & Preparation ==
== Requirements & Preparation ==


Please bring your laptop (if you have one) to the course, since there will be a couple of hands-on sessions throughout the course. For those who haven't a laptop, we'll build teams of two or three persons (which is of great value anyway). Also, having a reference book with you might be of value although it is not necessary.
Please bring your laptop (if you have one) to the course, since there will be a couple of hands-on sessions throughout the course. For those who haven't a laptop, we'll build teams of two or three persons (which is of great value anyway). Also, having any C/C++ reference book with you might be of value although it is not necessary.




=== Software & Systems ===
=== Software & Systems ===


Unix and Linux are
You need two pieces of software on your computer:
* Windows
 
* Unix/Linux
* A C/C++ compiler, and
**
* any plain text editor.
Zur Vorbereitung auf den Kurs kann ein Ausdruck der Folien dienen (siehe unten). Zusätzlich ist es hilfreich sich vorab mit den technischen Dingen vertraut zu machen. Dies hängt davon ab, wo man die Programmieraufgaben lösen möchte:
 
You should be familiar with your text editor and with the command line. If you use Linux/Unix, these systems come along with all the things you need, i.e. a compiler is installed (just doublecheck typing in g++ or gcc on the command line), and there's several text editors (vi, kedit, ...) available.


    * Wenn man in der SUN-Halle arbeitet, sollte man dort mit den Grundfunktionen vertraut sein (Textdateien bearbeiten, WWW-Browser)
If you are using Windows, I strongly recommend to install [http://www.mingw.org/ MinWG] before. Also, you should have Notepad or a similar editor at hand.
    * Wenn man auf seinem eigenen Rechner arbeiten will, kann man sich um einen C-Übersetzer kümmern (Funktion im Moment unwichtig, installieren kann man ihn auch so). Für Windows-Systeme sind drei (von vielen) kostenlosen Möglichkeiten Dev-C++ (mit schöner bunter Benutzeroberfläche) und Cygwin bzw. MinGW (enthalten beide einen kommandozeilenbasierten C-Übersetzer).
    * Hinweis für Windows Benutzer: Alternative zum üblichen "Editor" unter Windows, der manchmal Zeilenumbrüche von (unter Unix/Linux erstellten) Textdateien nicht korrekt wiedergibt, ist die "WordPad-MFC-Anwendung" die damit keine Probleme haben sollte.
    * Übersetzung und Ausführung von Programmen. Als Beispielprogramm kann das Programm prog0.cpp dienen.
          o Anleitung für die Sunhalle
            Vorausgesetzt wird, dass man sich soweit auskennt, dass man einen Webbrowser offen hat sowie ein Terminalfenster, um gleich die folgenden Kommandos eingeben zu können (am Anfang befinden wir uns dazu am besten in unserem Homeverzeichnis)
                + Ein neues Verzeichnis anlegen: mkdir EiPro
                + in dieses Verzeichnis wechseln: cd EiPro
                + Mittels des Browsers das Programm prog0.cpp in das neue Verzeichnis speichern
                + Wieder im Terminalfenster: Inhalt des Verzeichnisses anzeigen lassen: ls
                  (sollte "prog0.cpp" ausgeben)
                + Übersetzen: g++ prog0.cpp
                + Inhalt des Verzeichnisses anzeigen lassen: ls
                  (sollte "a.out" und "prog0.cpp" ausgeben)
                + Programm ausführen: ./a.out
                  (sollte a: 37, b: 41, c: -4, d : 6, e: 156 ausgeben)
                + Programm bearbeiten: nedit prog0.cpp &
                  Z.B. aus 37 eine andere Zahl machen, abspeichern, übersetzen, ausführen,...
          o Auf dem heimischen Rechner
            Hier nur ein paar kurze Hinweise für die Benutzer von Windows & Dev-C++:
                + Das Programm kann man mit Dev-C++ öffnen (File -> Open Project or File), bearbeiten und übersetzen (Execute -> Compile), das ausführbare Programm heißt hier in der Voreinstellung nicht a.out, sondern so wie der Quelltext, in unserm Fall also prog0.exe
                + Zum Ausführen ist ein Terminalfenster (Windows-Sprechweise: Eingabeaufforderung) hilfreich (wenn man das Programm innerhalb von Dev-C++ ausführt, verschwindet die Ausgabe, bevor man sie lesen kann...)
                  Das Navigieren in's richtige Verzeichnis mittels cd kann hier etwas komplizierter sein, je nachdem, in welchem Verzeichnis man am Anfang landet. Den Inhalt eines Verzeichnisses sehen wir hier mit dir; wenn wir im richtigen Verzeichnis sind, wird das Programm einfach mittels prog0 ausgeführt.
                + Es ist jedoch einfacher, im Programm vor der schließenden geschweiften Klammer noch eine Zeile std::cin.get(); einzufügen, dann wartet das Programm an dieser Stelle, bis man die Enter-Taste drückt und man kann das Programm auch innerhalb von Dev-C++ ausführen (Execute -> Run).  




Line 57: Line 55:
* [http://docs.sun.com/source/806-3568/ncg_goldberg.html What Every Computer Scientist Should Know About Floating-Point Arithmetic]
* [http://docs.sun.com/source/806-3568/ncg_goldberg.html What Every Computer Scientist Should Know About Floating-Point Arithmetic]
* [http://www.netzmafia.de/skripten/ad/ad13.html Remarks on C (German)]
* [http://www.netzmafia.de/skripten/ad/ad13.html Remarks on C (German)]
* [http://www.eclipse.org/cdt Eclipse with C/C++ Development Tooling]

Latest revision as of 06:34, 8 July 2011

The compact course on C/C++ takes place at the MPE from June 27, 2011, to July 8, 2011. It is tailored to Ph.D. students from the IMPRS. Lectures start at 9:30 s.t. and last for approximately 3 hours a 45 minutes, i.e. the course will finish around 12:15.

Lecture Notes

  • Monday, June 27: Introduction, Variables, and Identifiers
  • Tuesday, June 28: Control Structures
  • Wednesday, June 29: Functions
  • Thursday, June 30: Applicative Programming (and basic programming engineering)
  • Friday, July 1: Pointers, Structs, and Arrays
  • Monday, July 4: Pointers, Structs, and Arrays - Continued
  • Tuesday, July 5: Object-based Programming
    • Different room: Room 209 (Alter Seminarraum)
    • Slides
  • Wednesday, July 6: From Object-based Programming to Object-oriented Programming
  • Thursday, July 7: Object-oriented Programming - Continued
  • Friday, July 8: Generic Programming and Wrap-up


Requirements & Preparation

Please bring your laptop (if you have one) to the course, since there will be a couple of hands-on sessions throughout the course. For those who haven't a laptop, we'll build teams of two or three persons (which is of great value anyway). Also, having any C/C++ reference book with you might be of value although it is not necessary.


Software & Systems

You need two pieces of software on your computer:

  • A C/C++ compiler, and
  • any plain text editor.

You should be familiar with your text editor and with the command line. If you use Linux/Unix, these systems come along with all the things you need, i.e. a compiler is installed (just doublecheck typing in g++ or gcc on the command line), and there's several text editors (vi, kedit, ...) available.

If you are using Windows, I strongly recommend to install MinWG before. Also, you should have Notepad or a similar editor at hand.


External Links

These links are for further information on particular topics. They are not part of the core course.