diff options
author | Oskar <[email protected]> | 2024-08-07 22:39:51 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-07 22:39:51 +0200 |
commit | 9b931cfed1551961c8bbb93b21051104c0c4c716 (patch) | |
tree | 9232cc1246d35db36b0800e3d4af318f4e3905c9 /3p18.cpp | |
parent | 601e9571981ef44984e740ba71ce1648dbc223d3 (diff) |
more exercises
Diffstat (limited to '3p18.cpp')
-rw-r--r-- | 3p18.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/3p18.cpp b/3p18.cpp new file mode 100644 index 0000000..a35ff43 --- /dev/null +++ b/3p18.cpp @@ -0,0 +1,29 @@ +#include <iostream> +#include <vector> +#include "sales_data.hpp" +#include "sales_item.hpp" + +/* + * + * 3.18 + * + * + */ + +using std::string; +using std::cout; +using std::cin; +using std::cerr; +using std::clog; +using std::endl; +using std::vector; +int main () { + + vector<int> ivec1; + vector<int> ivec2(10); // We could initialize it with some elements + vector<int> ivec3{42}; // We could initialize it with the first element being 42 + ivec1.push_back(42); // One way we might fix it + ivec2[0] = 42; + cout << ivec1[0] << " " << ivec2[0] << " " << ivec3[0] << endl; + return 0; +} |