sorry i'm posting alot but you people are smart...
anywayz..
i've got an array:
AnsiString title[50];
and i eventually add values to the different indexs of the array.
for example
title[0] = "Bob";
title[1] = "Joe";
title[3] = "Skip";
now i don't fill up the last 46 slots or so...
when i goto do a while loop for saving data to a file it does a forever loop causing my program to loop constantly.(which obviously isn't good)
x = 0;
while (title[x] != Null)
{
file << title[x];
x = x + 1;
}
I've done a little reading and testing but i can't quite figure out the problem. I'm thinking that AnsiStrings that are empty aren't Null. And thats my problem i don't know what they are..Wouldn't title[x].c_str(); add null to end? or something i really don't know i'm lost..
ive tried:
x = 0;
while (title[x] != "")
{
file << title[x].c_str();
x = x + 1;
}
and
x = 0;
while (title[x] != " ")
{
file << title[x].c_str();
x = x + 1;
}
and
x = 0;
while (title[x].c_str() != Null)
{
file << title[x].c_str();
x = x + 1;
}
but always a forever loop. I've noticed NullStr(); function which i think i may need but i can't figure out how to use it.. the
file << title[x].c_str();
part works so my only problem is the while loop. Any help would be greatly appreciated