I have a problem referencing to Vectors using pointers i.e. I am not able to use "call by reference" on vector variables.
I have a "read()" function in "x.cpp" and "main()" in "y.cpp". I have 3 vector variables in Main(). I want the read function to read the values into the vector using the address I send of the vectors..
Sample code:
Expand|Select|Wrap|Line Numbers
- //x.cpp
- void read(vector <int> a,vector <int> b,vector < vector <int> > c)
- {
- //a, b, c are vector variables referencing to the vectors in main of y.cpp
- }
- //y.cpp
- void main()
- {
- vector <int> a;
- vector <int> b;
- vector < vector <int> > c;
- read(&a,&b,&c);
- //Sending the reference to read function in x.cpp to modify data in main
- }
I got a LNK#### error where # are numbers.
How do I get this program of mine to read values into the vectors by using references?
I need help as soon as possible
Thank You in Advance..