It returns gibberish because when that NextTag() returns the array
radial is destroyed, which invalidates tags[1]. What you need to do is allocate memory for the text. Then main() will have to delete[] that memory when its done with it.
tags[1] = new char[strlen(radia1)+1];
strcpy(tags[1], radia1);
Another way to do it is for main() to allocate memory for that string
char* tags[4] = {0};
char radia1[80];
tags[1] = radia1;
...
...
Last edited by Ancient Dragon; Nov 6th, 2009 at 10:34 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,954 posts
since Aug 2005