How do i split this two ? C++

Hi guys, im sorry if my English very bad :)

i got problem with this

char str[] = "staff101";

i would like to split "staff" and "101" and cout them.

im beginner in c++ hope you guys help me thank...

any idea guys if c++ can generate pdf because im using embedded sql c++ .
Iterate through the array and check each char with isdigit:
http://www.cplusplus.com/reference/clibrary/cctype/isdigit/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main ()
{
char str[]="1776ad";
int year;
if (isdigit(str[0]))
{
year = atoi (str);
printf ("The year that followed %d was %d.\n",year,year+1);
}
return 0;
}

How did i need to modified ?
a) You're not looping. Your only checking the first digit.
b) Your atoi'ing the entire string. You only need the digit part, which you have to find by looping.
Topic archived. No new replies allowed.