TDDE18 & 726G77
Programming in C++
TDDE18 & 726G77 Programming in C++ Administration Examiner - - PowerPoint PPT Presentation
TDDE18 & 726G77 Programming in C++ Administration Examiner Eric Elfving Course leader Sam Le Assistant 1 Eric Petersson Assistant 2 Alexander Johansson Assistant 3 Mathias Berggren Assistant 4
Programming in C++
All information you need to complete the course exists
https://code.visualstudio.com/
lab partner
them to relevant problems.
Linux/UNIX system.
problems.
int main() { }
Program
Program
int main() { std::cout << “Hello world”; …
Program Hello world
std::cout << “Hello world”; …
Program Hello world
std::cout << “Hello world” << std::endl; …
Program
std::cout << “Hello world”; std::cout << “!!!” << std::endl;
? ?
Value Type Example:
Program 3
int main() { int x{}; cin >> x; …
Program int x{0}; std::cin >> x; … 3
Program int x{0}; std::cin >> x; std::cin >> x; 34 99
Value Type string s{“hello”} s.size() s.front()
std::string s{“temp”}; std::cin >> s; … Hello World Program
Program
std::string s{“temp”}; std::getline(std::cin, s); … Hello World
#include <iostream> int main() { std::cout >> “Hello world” >> std::endl; }
#include <iostream> using namespace std; int main() { cout >> “Hello world” >> endl; }
int main() { int x{}; int y{}; int z{}; cout << z; }
int main() { string s{}; cout << s; }
int main() { int x{}; cout << setw(5) << setfill(‘0’) << x << endl; }
int main() { string s{}; getline(cin, s); cout << s.front() << “ “ << s.back() << endl; } Hello World!!?
g++ file1 [file2…] [flags]
g++ file1 g++ file1 file2 g++ file1 –Wall g++ file1 –Wextra –Wall –Wpedantic