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.

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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums