The title space is not enough to explain my problem.
I have a my_function at class A:
void my_function(char array1[],char array2[]);
void my_function(char array1[],char array2[]);
To copy to clipboard, switch view to plain text mode
I call it so:
my_function(classb->give_me_array(22), classb->give_me_array(33));
'Give_me_array' located at another class B, receive an index and fill the internal array with 5 values.
char * give_me_array(int index) {
fill internal_array....
return internal_char_array;}
char * give_me_array(int index) {
fill internal_array....
return internal_char_array;}
To copy to clipboard, switch view to plain text mode
internal_char_array is a char array[5] declared as private for this class
Ok, my problem is that my_function receives the value for 33 also for 22. ( I think that this is a pointer problem) . How to solve this ?
I'd not want to use two aditional arrays and function calls to solve the problem.
Any idea ?
I'd need a trick to make an instant copy ....
Thanks
Bookmarks