Click here to Skip to main content
15,896,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGettin an error... Pin
Pheonix288-Dec-04 15:36
sussPheonix288-Dec-04 15:36 
GeneralRe: Gettin an error... Pin
Tom Wright8-Dec-04 16:19
Tom Wright8-Dec-04 16:19 
GeneralRe: Gettin an error... Pin
bryce8-Dec-04 17:46
bryce8-Dec-04 17:46 
GeneralRe: Gettin an error... Pin
Cedric Moonen8-Dec-04 22:24
Cedric Moonen8-Dec-04 22:24 
General2 ?'s Pin
3dman8-Dec-04 15:10
3dman8-Dec-04 15:10 
GeneralRe: 2 ?'s Pin
Maximilien8-Dec-04 15:22
Maximilien8-Dec-04 15:22 
Generalremove an icon from the status tray (system tray) Pin
Tom Wright8-Dec-04 14:44
Tom Wright8-Dec-04 14:44 
GeneralHelp with Strtok Pin
civicnar8-Dec-04 13:43
civicnar8-Dec-04 13:43 
Here is the section out of my program that I am having problems with.

char first[20];



ifstream
fin;


openfile(fin);


char str[20];
char* trun;
char* trun2;
char *seps = "\0";

while (!fin.eof())
{fin.getline(str, 30, '\n');
fin.ignore(1);
cout<<str<<endl;
trun = strtok (str,seps);
cout<<"---"<<trun<<"---\n";
if (!doRetrieveVertex (graph, trun))
{doInsertVertex (graph, trun);}
strcpy(first, trun);

while (trun2 != NULL)
{ cout<<trun2;
trun2 = strtok (NULL, seps); \\Here

if (!doRetrieveVertex (graph, trun2))
doInsertVertex (graph, trun2);


cout<<"Internal while";
}
cout<<"External while";

}

1 2 50 3 70 4 23
2 1 50 3 34 4 75
3 1 70 2 34 4 80
4 1 23 2 75 3 80


Here is some sample data that we created and also I changed where seps is to " " so that it will break it into pieces. Basically what it is doing is getting the first line and then breaking off th efirst piece and retaining that and then breaking the others off and adding those. We are making a graph if you are wondering.


If I comment out where it says "trun2 = strtok (NULL, seps);" Then it will run but it stays in an infinite loop inside that Internal while loop. But if I do not then I get a core dump. Please help me if you can it is due tomorrow. Thanks

James

GeneralRe: Help with Strtok Pin
Christian Graus8-Dec-04 13:47
protectorChristian Graus8-Dec-04 13:47 
GeneralRe: Help with Strtok Pin
civicnar8-Dec-04 15:17
civicnar8-Dec-04 15:17 
GeneralRe: Help with Strtok Pin
Blake Miller9-Dec-04 3:49
Blake Miller9-Dec-04 3:49 
GeneralCListCtrl Item Height Pin
Blake Miller8-Dec-04 12:46
Blake Miller8-Dec-04 12:46 
GeneralRe: CListCtrl Item Height Pin
alex.barylski8-Dec-04 15:06
alex.barylski8-Dec-04 15:06 
GeneralFlicker occurs when resizing CListCtrl Pin
Cyrus Dang8-Dec-04 10:49
Cyrus Dang8-Dec-04 10:49 
GeneralRe: Flicker occurs when resizing CListCtrl Pin
alex.barylski8-Dec-04 11:42
alex.barylski8-Dec-04 11:42 
GeneralRe: Flicker occurs when resizing CListCtrl Pin
Cyrus Dang8-Dec-04 12:00
Cyrus Dang8-Dec-04 12:00 
GeneralProper way to install drivers in the windows/system32/drivers directory Pin
hyling8-Dec-04 10:18
hyling8-Dec-04 10:18 
QuestionHow to retrieve dialog settings when the dialog open again Pin
Anonymous8-Dec-04 10:11
Anonymous8-Dec-04 10:11 
AnswerRe: How to retrieve dialog settings when the dialog open again Pin
Peter Weyzen8-Dec-04 10:20
Peter Weyzen8-Dec-04 10:20 
AnswerRe: How to retrieve dialog settings when the dialog open again Pin
David Crow8-Dec-04 10:33
David Crow8-Dec-04 10:33 
AnswerRe: How to retrieve dialog settings when the dialog open again Pin
Yulianto.8-Dec-04 15:45
Yulianto.8-Dec-04 15:45 
GeneralBluetooth device start problem... Pin
Orkun GEDiK8-Dec-04 10:11
Orkun GEDiK8-Dec-04 10:11 
GeneralWin XP -&gt; Win 98 Pin
kajono8-Dec-04 9:40
kajono8-Dec-04 9:40 
GeneralRe: Win XP -&gt; Win 98 Pin
David Crow8-Dec-04 10:32
David Crow8-Dec-04 10:32 
GeneralRe: Win XP -&gt; Win 98 Pin
kajono8-Dec-04 21:37
kajono8-Dec-04 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.