Help needed on NXC
Posted: 23 Sep 2012, 17:41
hi, here something I wrote, I've got a file error when running.
It seems there is a problem accessing the array !
string str[];
int NbStr=0;
void sub();
{
NbStr=0;
if (something)
{
NbStr+=1;
str[NbStr]="Q";
}
if (something)
{
NbStr+=1;
str[NbStr]="R";
}
}
task main()
{
int i;
while (true)
{
sub();
if (NbStr>0)
{
for (i=1;i<=NbStr;i++)
{
TextOut(i*8,LCD_LINE3,str); // here is the line that causes the error !
}
}
}
}
what is wrong there ???
thanks in advance.
It seems there is a problem accessing the array !
string str[];
int NbStr=0;
void sub();
{
NbStr=0;
if (something)
{
NbStr+=1;
str[NbStr]="Q";
}
if (something)
{
NbStr+=1;
str[NbStr]="R";
}
}
task main()
{
int i;
while (true)
{
sub();
if (NbStr>0)
{
for (i=1;i<=NbStr;i++)
{
TextOut(i*8,LCD_LINE3,str); // here is the line that causes the error !
}
}
}
}
what is wrong there ???
thanks in advance.