954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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++ .

apert
Newbie Poster
1 post since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

not that hard, just locate the first numeric digit then copy both parts to new char arrays

char str[] = "staff101";
char s1[6], s2[6];
strnapy(s1,str,5);  // copy first 5 characters
strcpy(s2,&str[4]); // copy remaining characters

>>any idea guys if c++ can generate pdf
See this thread

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: