I am a beginner of c++ as you see this post in beginner section :). Iam having troubles with running small programs created as practice. In this program, I am trying to get inputs from a function and add to the vector and print the vector.
FYI: I am using codeblocks compiler.
vector <int> *_vote;
int choice = choose();
_vote = new vector <int>();
int choose (int x)
cout<< "Enter your choice, 1,2 or 3: ";
The error displayed:
\Vect_pract02.cpp: In function 'int main()':
\Vect_pract02.cpp:12:9: error: 'i' was not declared in this scope
\Vect_pract02.cpp:14:29: error: too few arguments to function 'int choose(int)'
\Vect_pract02.cpp:7:5: note: declared here
\Vect_pract02.cpp: In function 'int choose(int)':
\Vect_pract02.cpp:24:8: error: declaration of 'int x' shadows a parameter
Thanks for the reply, but i have tried like how you did initially. And had tried the same way again now.. not working, and throwing the same error. Will it be because i am using code blocks rather than visual c++ ?