N
Nicholas
How can I compare char* with integers and characters contained in the str,
where integers can be one digit or more?
void Access(char *str) {
char *pt = str;
while (pt != '0') {
if (isalpha(*pt))
printf("A character is found\n");
else if (*pt == '=')
printf("Equal sign is found\n");
// This is the problem
--1) else if (isdigit(*pt))
printf("Only a single digit is accesed usin char*\n"); // It
wont work if the integer is 24, it is only
// accessing '2'
etc. etc.
How can I improve this code to access integers not limited only to 1 digit,
say for an example,
the string is separated by mixed of commas, colons and perios.
example of char *str = "24,5:300.123;
Thank you for the advice
where integers can be one digit or more?
void Access(char *str) {
char *pt = str;
while (pt != '0') {
if (isalpha(*pt))
printf("A character is found\n");
else if (*pt == '=')
printf("Equal sign is found\n");
// This is the problem
--1) else if (isdigit(*pt))
printf("Only a single digit is accesed usin char*\n"); // It
wont work if the integer is 24, it is only
// accessing '2'
etc. etc.
How can I improve this code to access integers not limited only to 1 digit,
say for an example,
the string is separated by mixed of commas, colons and perios.
example of char *str = "24,5:300.123;
Thank you for the advice