indexof problem: request for member indexof in ..
hello,
i use indexof function arduino 0019 program:
part of code:
int bytesread=0;
int maxbytes=5000;
string filecontents[maxbytes];
bytesread=file.read(filecontents, maxbytes);
if (bytesread >= maxbytes) pgmprint("error data in config file ");
file.close(); //close file
serial.println("bytesread");serial.print(bytesread);
// serial.print(filecontents);
char line[80];
int sensorcounter;int weekdaycounter;int programcounter;
int oldposchar=0;
int newposchar=(filecontents.indexof(';',0));
so read file (via sd shield) in string filecontents.
i following error on indexof function:
request member 'indexof' in 'filecontents', non-class type 'string [(((unsigned int)(((int)maxbytes) + -0x000000001)) + 1)]'
can tell me i'm doing wrong ?
thanks in advance,
jeroen.
i use indexof function arduino 0019 program:
part of code:
int bytesread=0;
int maxbytes=5000;
string filecontents[maxbytes];
bytesread=file.read(filecontents, maxbytes);
if (bytesread >= maxbytes) pgmprint("error data in config file ");
file.close(); //close file
serial.println("bytesread");serial.print(bytesread);
// serial.print(filecontents);
char line[80];
int sensorcounter;int weekdaycounter;int programcounter;
int oldposchar=0;
int newposchar=(filecontents.indexof(';',0));
so read file (via sd shield) in string filecontents.
i following error on indexof function:
request member 'indexof' in 'filecontents', non-class type 'string [(((unsigned int)(((int)maxbytes) + -0x000000001)) + 1)]'
can tell me i'm doing wrong ?
thanks in advance,
jeroen.
code: [select]
string filecontents[maxbytes];the square brackets define array of string instances. wanted parentheses define single instance of maximum size.
the filecontents array, then, not have indexof operator.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > indexof problem: request for member indexof in ..
arduino
Comments
Post a Comment