Hi everybody!
In my TMemo (name: MemoMain) there are following datas:
3
0 1 1
1 0 1
1 1 0
I must read them to a variable int and an array int A[][];
After reading:
n==3;
A[0][1]==0 A[0][2]==1 A[0][2]==1
A[1][0]==1 A[1][1]==0 A[1][2]==1
A[2][0]==1 A[2][1]==1 A[2][2]==0
I did like this:

int n = StrToInt(MemoMain->Lines->Strings[0][0]);
for(int i=1; i<=n; i++)
     for(int j=0; j<n; j++)
        A[i][j]=StrToInt(MemoMain->Lines->Strings[i][j]);

but did not work.
So please help me with this.

Recommended Answers

All 2 Replies

Hi,

Just so I understand, why do you start iterator i on 1?

Cheers,
Erik

interator starts from 1 because the first of matrix is the second line of TMemo. Any suggestion?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.