I have a program that looks likes this. And a class with a method "Read_text" that will populate the array "s_text[][]" and also enter the contents into "Full_text".
Somehow, I just can't seems to access the elements in obj_A.s_Text[][]. I am not sure what is wrong with "SomeText=obj_A.s_Text[2][2]". I have tested during breakpoints to monitor and confirm that the array is properly popluated with correct data. However, when I try to access from the main() function, can't seems to access the data at all.
Sorry if the post is difficult to read as I'm just a beginner.
Thanks for any advises.
Part of the code is produced below.
=====================
void main()
{
CSomeClass obj_A;
CString SomeText;
obj_A.Read_Text(); // Read Data
MessageBox (obj_A.Full_Text) // Shows the contents
SomeText=obj_A.s_Text[2][2] // Unable to read the contents
}
class CSomeClass
{
public:
void Read_Text();
CString Full_Text;
CString s_Text[5][5];
Hmmm. From the code posted, things look okay to me. Could you post the implementation of CSomeClass::Read_Text and perhaps that will help.
I took the liberty of making one myself, and things seem to work okay. I converted this to use the console, plus "standard" c++ rather than Microsoft specific, just to make it easy for me.