Convert Char to int?

I am trying to convert a char to an integer variable.

#if defined(ARDUINO) && ARDUINO > 18
#include <SPI.h>
#endif
#include <Ethernet.h>
#include <EthernetDHCP.h>

setup()
{
int gatestatus;
gatestatus = readvalues();
}
int readvalues()
{
    Serial.println("In Read Values");
    while(1)
    if (client.connect()) {
    Serial.println("Readvalues client connected");
    client.println("GET /headgateget.php");
    client.print( millis() );          // prevent caching, like justjed said a post before
    client.println("HTTP/1.0");                // no need for 1.1
    client.println("Host: cs14.sheridanc.on.ca");
    // client.println("Connection: close");
    client.println();
   //delay(7);
    while (client.connected()){
      if (client.available()) {
      Serial.println("client is avaliable printing page");
      char c = client.read();
      Serial.println("parsed page, C=");
      Serial.println(c);
      delay(100);
      s = (int)c;
      return s;
      }
    }
    }
    
    
    if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    
    
    }
}

This is a small excerpt from my code.
I tried doing it this way but when it returns s it returns the value 48 everytime. C is only equal to a 1 or a 0, in the serial prints it confirms this. However converting it to an integer doesnt seem to work the way I would assume. I searched around and tried atoi() but it says that it is not a function.

The ascii code for the character 0 has the value 48. If you subtract '0' from your character, you will get the value of the digit represented.

'atoi' is most certainly a function.

c is a char variable that received ‘0’ or ‘1’, NOT 0 or 1.

0 = ‘0’ - ‘0’
1 = ‘1’ - ‘0’

oh sounds easy enough so i should write s = c - '0';

so i should write

Yes.

thanks guys!