ISO C++ forbids comparison between pointer and integer error when download file

Hi,
I am downloading a file from an FTP server to volatile memory (char array), then do some processing on data then write to an SD card. But i am getting an “ISO C++ forbids comparison between pointer and integer” error. I sort of know the reason for the error but don’t know how to get around it.

The code is below. Is used with the MKR 1400 GSM board. The file being downloaded is a configuration file.

If i take out the while loop and just use the for loop it works fine but i need to process some of the initial characters of the file.

Any help is much appreciated.

Cheers.

void downLoadConfig() {
  char setupInfo[256];

  response("Connect to FTP server",
    ftp.connect(SERVER, USERNAME, PASSWORD, PORT));

  response("Change to current remote directory",
    ftp.cd(ftpPath));

  response("download from FTP server to volatile mem",
    ftp.read((uint8_t *)setupInfo, sizeof(setupInfo), "setup.ini", 20000));
  
  //write setupInfo buffer to file on SD Card
  tempFile = SD.open("setup.ini");  //defaults to read so file must exist
  if (tempFile) {
    while (1) {
      char chr = setupInfo[n];
      if (chr == ";") {break;}     //***this creates the error but how to get around it?***
      n++;
    }
    for (int m=n;m<=256;m++) {tempFile.print(setupInfo[m]);}
  }
  else {Serial.println(F("setup file write error"));}
  tempFile.close();
  n=0;
  
}

if (chr == ";") should be if (chr == ';')chr is a 'char' ";" is a char*

Deva_Rishi:
chr is a 'char' ";" is a char*

I think you meant....
';' is a char
";" is a char*

I think you meant....
';' is a char
";" is a char*

No i meant it the way i wrote it. Comparison was if (chr == ";")And earlier chr was declared as char chr = setupInfo[n];Which explains the error message, which is what i meant to do. I figured the solution was nearly self explanatory. Your statement is of course also true (except for the 'I think you meant....' bit.)

Deva_Rishi:
No i meant it the way i wrote it.

Deva_Rishi:
chr is a ‘char’ “;” is a char*

Umm… I see.

Not very clear enclosing char in single quotes, when you’re trying to explain the difference between single and double quotes, if you ask me. I do know the difference, and that subtly of your chosen syntax was lost on me.

Hi Guys,
And thanks for the replies.

I am such an idiot for missing that - what a beginner mistake!

Thanks for all your help.

Cheers.

Not very clear enclosing char in single quotes, when you’re trying to explain the difference between single and double quotes, if you ask me. I do know the difference, and that subtly of your chosen syntax was lost on me.

To take that sentence (part) out of context is not doing my reply / explanation justice in my opinion. But as i said, i meant what i wrote. It is not for you to decide what i mean when i write something. If you think your explanation is clearer, i may even agree. Having both explanations there was clearly enough for the OP.