Search for tag: "contents"

Vector, Part 2) Iterate over contents of vector in C++

#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) { …

+19 More
From  Lane Schwartz 8 plays 0  

Vector, Part 1) Create non-empty vector in C++

#include <vector> using std::vector; int main() { auto my_data = vector<int>{17, 25, -300, 14}; return 0; }

+19 More
From  Lane Schwartz 10 plays 0  

Basic I/O, Part 7) Read ints from file

+16 More
From  Lane Schwartz 17 plays 0  

Basic I/O, Part 2) Read int from user

+19 More
From  Lane Schwartz 14 plays 0  

Basic I/O, Part 9) Write ints to file

+16 More
From  Lane Schwartz 16 plays 0  

Simplest C++ program - compile the program

Compile the simplest possible C++ program using the g++ compiler. g++ -std=c++17 -o sample sample.c++

+19 More
From  Lane Schwartz 9 plays 0