For example:
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
char Stuff[] = "ADC 1 255";
char * pStuff;
long int /* Notneeded, */ ADCchannel, ADCvalue;
//Notneeded = strtol (Stuff,&pStuff,32);
ADCchannel = strtol (&Stuff[4], &pStuff, 0);
ADCvalue = strtol (pStuff, NULL, 0);
printf ("The ADC value at channel %ld is %ld.\n", ADCchannel, ADCvalue);
return 0;
}
or maybe this works if channel is 0 - 99
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
char Stuff[] = "ADC 1 255";
long int ADCchannel, ADCvalue;
ADCchannel = strtol (&Stuff[4], NULL, 0);
ADCvalue = strtol (&Stuff[6], NULL, 0);
printf ("The ADC value at channel %ld is %ld.\n", ADCchannel, ADCvalue);
return 0;
}