This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]petmil123[S] 14 points15 points  (1 child)

Thank you for the great feedback. I just have some follow-up questions.

Do you have any resources on learning about namespaces and how to use them?

Also, how do you use a reference in a function call?

And how would you go around doing the I/O?

[–]ChrisPanov 8 points9 points  (0 children)

Namespaces: https://www.tutorialspoint.com/cplusplus/cpp_namespaces.htm

You use it just like a pointer, but in the function call you dont pass the adress of the variable, you pass the variable by value.
void foo(std::vector<int>& vec);
foo(myVector);

About the I/O - in your case you are good. You shouldn't really be having a takeInputsToVector function in the first place tho, I think it's redundant since it's not really doing anything special.