Hi,
What I'm attempting to do is send data from one class, to another and then store it in that second class as an array.
E.g.
file class1.cpp
class1{
Class2 c;
c.methodAdd(Variable1, id);
cout << c.methodGet(2);
}
file class2.h
class2{
typedef string StringArrayPtr;
StringArrayPtr *array = new StringArrayPtr[3]; //create the array
void methodAdd( string var1, int id){
array[id] = var1;
}
string methodGet(int id){
return array[id]
}
}
This isnt the actual code im using (i have a lot more bits in-between - but thats the general jist of what I need. I've been puzzling over it for the past 4 hours :S
Basically, an external class method which adds data to an array, and then can retrieve the values from it.
Any ideas??
Thanks in advance!!
Mike