|
#include <iostream>#include <vector>
using std::cout;
using std::vector;
int main() {
auto my_data = vector<int>{17, 25, -300, 14};
for (auto item : my_data) {
…
|
|
|
|
#include <iostream> int main() { for (int n{10}; n > 0; n = n - 1) { std::cout << n << "\n"; } }
|
|
Compile the simplest possible C++ program using the g++ compiler. g++ -std=c++17 -o sample sample.c++
|
|
Every function has four parts: return type name list of arguments body int main() {
return 0;}
|
|
|
|
|
|
|
|
This video describes the simplest possible C++ program.
|