I have an object that is created from another void that loads it's values from a file.
Now I'm trying to edit these values using another function, I've tried using a reference type but it doesn't work it still stays as the same value.
1 2 3 4 5 6 7
cout << square_objects[5]->rent; //is 50
//in this class function I want too be able too change the value of square_object[5]->rent, or anything to do with the square object.
engine->land_function(0,0);
cout << square_objects[5]->rent; //is still 50
square is a function that loads the object values from a textfile.
square_objects[1]->name; // would give the name of the second square.
Now, I've got a new function called engine, I was wondering how I can manipulate these values in that function and still be able to return too this in the main:
square_objects[1]->name; // would give the name of the second square. //should be edited, but it's not working.
I can't get refereing too work, it just keeps throwing out loads of errors.
another example:
1 2 3 4 5 6 7
cout << square_objects[5]->rent;
//testing to try and alter the iterators in this run main
engine->land_function(0,0);
cout << square_objects[5]->rent;
The problem in your previous post was that you didn't put a & on line 3. There is nothing I can find in your last post. There's just too little code. Post how you declare the function, how you define it and how you call it.