QUOTE(letthecolorsrumble @ 14 Mar, 2008 - 08:30 PM)

Yes, it can be an array of char, although not recommended to use. If you define the array length to be 100 , a maximum of 99 characters can be stored in that array, the last character being '\0'.
Way to read: is.getline(buffer, 100, '\n');
Hope this helps.
In my actual code, the is.read loops several times, say 3*500 times, each time with fresh values stored in buffer. So would declaring buffer[100] outside result in an exceptional error violating the max size?...I also thought of a possible solution for it being declared as static buffer[100]={0}; , wherein it overwrites previous values to 0(zero). Is this required or does the function is.read itself overwrite its previous values?
Also as you mentioned can it hold only 99 characters?.....isn't it 0-99 which is 100 characters?
To be more clear i have the variable as follows:
CODE
for(int i=0;i<3;i++)
{
for(int j=0;j<500;j++)
{
// static signed char buffer[100]={0}; // is this required??
is.read((char*)buffer,100);
}
}
Thanks,
prads
This post has been edited by prads: 14 Mar, 2008 - 08:03 PM