Hydroinformatik I: Hello World

Ähnliche Dokumente
Hydroinformatik I: Hello World

Grundlagen der Programmierung

Kurzeinführung in C/C++ Informationsquellen: - Webseite zur Vorlesung, Abschnitt Informationen zu C und C++ Einleitung

Hello World! Eine Einführung in das Programmieren Das erste Programm

Programmierkurs C++ Grundlagen. Prof. Dr. Stefan Fischer Institut für Telematik, Universität zu Lübeck

Hydroinformatik I: Referenzen und Zeiger

Hydroinformatik I: IO - Files

Ziele. C und C++ Was ist C? Übersicht. Überblick. C und C++ im Vergleich zu anderen Programmiersprachen einordnen können

Pascal Nasahl Gruppe 5 Tutorium 1

Programmieren in C. Eine Einführung in die Programmiersprache C. Prof. Dr. Nikolaus Wulff

Installationsanleitung

Angewandte Umweltsystemanalyse: Finite-Elemente-Methode (FEM) #3

Hydrosystemanalyse: Finite-Elemente-Methode (FEM)

Hydroinformatik I: Introduction

Modellierung Hydrosysteme: Finite-Differenzen-Methode (FDM)

HYDROINFORMATIK. Integrated development environments IDEs. JProf. Dr. rer. nat. Marc Walther

Pascal Nasahl Gruppe 3 Tutorium 1

Teil IV Die Programmiersprache C++

1. Übung zu "Numerik partieller Differentialgleichungen"

Hydroinformatik II: Finite Differenzen Methode

Programmieren 3 C++ Prof. Peter Sommerlad Fredy Ulmer

Rechnerorganisation Tutorium Nr. 1

3D Programmierpraktikum: Einführung in C++ - Teil 1

Compiler Präprozessor Header Files

Grundlagen der Programmentwicklung

Die Programmiersprache C++ Einführung / Datentypen

Informatik - Übungsstunde

Informatik I. Übung 2 : Programmieren in Eclipse. 5. März Daniel Hentzen

C++ - Eine Ubersicht fur Java-Programmierer

6. Grundlagen der Programmierung

Compiler Präprozessor Header Files

C++ Kurs Teil 1. Architektur, Anwendungsspektrum, primitive Datentypen, Funktionsaufrufe, Referenzen, Klassen

Angewandte Mathematik und Programmierung

Objektorientierte Programmierung mit C++ Dr. K. Ahrens

Vergleich verschiedener OO-Programmiersprachen

Grundlagen der Informatik - 6. Praktikum

Programmentwicklung ohne BlueJ

2.4 Das erste C++-Programm *

Programmieren in C. Eine Einführung in die Programmiersprache C. Prof. Dr. Nikolaus Wulff

Einführung in C ++ und die Objektorientierte Programierung

Einführung in die Programmierung Wintersemester 2016/17

Informatik I - Übung 2 Programmieren in Eclipse

Informatik I (D-ITET)

Einleitung Entwicklung in C Hello-World! Konstrukte in C Zusammenfassung Literatur. Grundlagen von C. Jonas Gresens

Java Tools JDK. IDEs. Downloads. Eclipse. IntelliJ. NetBeans. Java SE 8 Java SE 8 Documentation

Einführung in C++ Philipp Lamby. RWTH Aachen Institut für Geometrie und Praktische Mathematik. (Karsten Urban, Markus Jürgens, Jürgen Vorloeper)

Wo und wie lange leben Objekte? globale Objekte lokale Objekte dynamische Objekte

Einführung in die Programmierung mit C++

Objektorientierung Grundlagen

Entwicklung mit mehreren Dateien

Vorsemesterkurs Informatik

DLLs (dynamic loaded libraries) mit MingW erstellen

Grundkurs C++ IDE Klassenhierarchien

Ziel, Inhalt. Programmieren in C++ Wir lernen wie man Funktionen oder Klassen einmal schreibt, so dass sie für verschiedene Datentypen verwendbar sind

C++ Was ist C++? Wie erstellt man ein C++ Programm? Scope-Operator :: Operatoren «,» Hello World! mit C++ main. cout, cin, endl.

Interaktive Simulationen Lektion 1/3: Event-Driven Design und Signals

Transkript:

Hydroinformatik I: Hello World Prof. Dr.-Ing. habil. Olaf Kolditz 1 Helmholtz Centre for Environmental Research UFZ, Leipzig 2 Technische Universität Dresden TUD, Dresden Dresden, 27. Oktober 2017 1/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Time Table 2/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

IDEs, Compiler... Which one... ECLIPSE Visual Studio Community (MS) https: //tutorials.visualstudio.com/cpp-console/intro Qt (https://www.qt.io/download/) cygwin (https://www.cygwin.com/) MinGW (http://www.mingw.org/) MinGW, a contraction of Minimalist GNU for Windows, is a minimalist development environment for native Microsoft Windows applications. GNU GNU is a recursive acronym for GNU s Not Unix! https://en.wikipedia.org/wiki/gnu XCode... 3/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

IDEs, Compiler... Which one... Wer hat welchen Compiler? Win Mac Linux Ubuntu... Compiler 2017 4/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Übungen Download 5/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Compiler - How it works Editor Source file Header file Compiler Object file Linker Libraries Executable Abbildung: Quell-Code Kompilation 6/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Hello World Skript 1.4, Übung E1 C #include <stdio.h> int main() { printf("hallo C world\n"); return 0; } C++ #include <iostream> //using namespace std; int main() { std::cout << "Hallo C++ World, wirklich?" << std::endl; return 0; } 7/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Main-Function function type function name function arguments function start function end int main() {... return 0; } function block Abbildung: Struktur der Funktion main() 8/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Exercise E1 Abbildung: cygwin aufrufen Abbildung: cygwin drive ist /cygwin/home/user, wechseln zum Arbeitsverzeichnis cd c:/myworkdirectory (oder copy und paste) Abbildung: slash (/) ist nicht gleich slash (\) 9/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Exercise E1A Die einzige C Übung: #include <stdio.h> int main() { printf("hello World"); return 0; } 10/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Exercise E1A Abbildung: Kommandozeile: gcc main.c, das Ergebnis ist a.exe, Aufruf des Programms:./a Jetzt endlich zu C++... 11/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Exercise E1A Jetzt aber endlich zu C++... #include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; } 12/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Exercise E1A Abbildung: Kommandozeile: g++ main.cpp, mit ls den Inhalt des Verzeichnisses ansehen, das Ergebnis ist a.exe, Aufruf des Programms:./a 13/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

C und/oder C++ Exercise E1C (oder HW2) Compilieren sie den Quelltext main.c mit dem C Compiler gcc. Compilieren sie den Quelltext main.cpp mit dem C++ Compiler g++. Compilieren sie den Quelltext main.c mit dem C++ Compiler g++. Compilieren sie den Quelltext main.cpp mit dem C Compiler gcc. KF 14/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Objekt-Orientierung Historical Note 15/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Objekt-Orientierung Historical Note 1983: Bjarne Stroustroup at ATT Lab Inspirations: C++ owes much to C (Kernighan 1978) Simula67 (Dahl 1972) class concept virtual functions Algol68 (Woodwad 1974) overloading operators declarations in header files Template facilities (list, vector, map container) Name C++: signifies the evolutionary nature of the changes from C ( ++ is the increment operator) 1991: C++ became ANSI and ISO standards 16/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Objekt-Orientierung 17/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Objekt-Orientierung 18/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Objekt-Orientierung 19/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Visual C++ (appetizer) Abbildung: Grafischer Dialog - Hydroinformatik I* (-2012) 20/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++

Visual C++ (appetizer) Abbildung: Grafischer Dialog - Hydroinformatik II 21/21 Prof. Dr.-Ing. habil. Olaf Kolditz Hydroinformatik I C++