Click here to Skip to main content
15,897,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: memset vs SecureZeroMemory Pin
Richard MacCutchan8-Feb-10 22:46
mveRichard MacCutchan8-Feb-10 22:46 
QuestionCluster Size Pin
john56328-Feb-10 17:51
john56328-Feb-10 17:51 
AnswerRe: Cluster Size Pin
Adam Roderick J8-Feb-10 18:01
Adam Roderick J8-Feb-10 18:01 
GeneralRe: Cluster Size Pin
john56328-Feb-10 18:05
john56328-Feb-10 18:05 
GeneralRe: Cluster Size Pin
Adam Roderick J8-Feb-10 18:47
Adam Roderick J8-Feb-10 18:47 
QuestionCombo box droplist selection Pin
dipuks8-Feb-10 11:20
dipuks8-Feb-10 11:20 
AnswerRe: Combo box droplist selection Pin
Luc Pattyn8-Feb-10 11:31
sitebuilderLuc Pattyn8-Feb-10 11:31 
QuestionProblem with output [modified] Pin
gregarion8-Feb-10 6:56
gregarion8-Feb-10 6:56 
Hey guys, i am having problem with displaying my text. my text file is displayed in such a way and is called test.......

Sam Worthington ... Jake SullyasZoe Saldana ... NeytiriasSigourney Weaver ... Dr. Grace AugustineasStephen Lang ... Colonel Miles QuaritchasJoel Moore ... Norm Spellman (as Joel David Moore)asGiovanni Ribisi ... Parker SelfridgeasMichelle Rodriguez ... Trudy ChaconasLaz Alonso ... Tsu'teyasWes Studi ... EytukanasCCH Pounder ... MoatasDileep Rao ... Dr. Max PatelasMatt Gerald ... Corporal Lyle WainfleetasSean Anthony Moran ... Private FikeasJason Whyte ... Cryo Vault Med TechasScott Lawrence ... Venture Star Crew Chiefmore


What i am trying to do is for the program to read "as" and then from there start a new line... thus the expected output is...




Sam Worthington ... Jake Sully
Zoe Saldana ... Neytiri
Sigourney Weaver ... Dr. Grace Augustine
Stephen Lang ... Colonel Miles Quaritch
Joel Moore ... Norm Spellman (as Joel David Moore)
.........(and so on)




This is my coding..



string templine ;
string line;
ifstream myfile ("test");


while (getline (myfile,templine) )
line.append(templine);

char str [] = line ;
char delims[] = "as";
char *result = NULL;
result = strtok( str, delims );
while( result != NULL ) {
printf( result );
result = strtok( NULL, delims );
}



I keep getting the error saying ...

editmain.cpp.98:error: initializer fails to determine size of 'str'
modified on Monday, February 8, 2010 1:41 PM

AnswerRe: Problem with output Pin
Avi Berger8-Feb-10 7:55
Avi Berger8-Feb-10 7:55 
AnswerRe: Problem with output Pin
KingsGambit8-Feb-10 8:26
KingsGambit8-Feb-10 8:26 
GeneralRe: Problem with output Pin
Richard MacCutchan8-Feb-10 8:59
mveRichard MacCutchan8-Feb-10 8:59 
GeneralRe: Problem with output Pin
KingsGambit8-Feb-10 9:04
KingsGambit8-Feb-10 9:04 
GeneralRe: Problem with output Pin
Richard MacCutchan8-Feb-10 9:56
mveRichard MacCutchan8-Feb-10 9:56 
GeneralRe: Problem with output Pin
KingsGambit8-Feb-10 18:14
KingsGambit8-Feb-10 18:14 
QuestionFile Input/Output Problem [solved] Pin
Eugén Jung8-Feb-10 5:39
Eugén Jung8-Feb-10 5:39 
AnswerRe: File Input/Output Problem Pin
Abhi Lahare8-Feb-10 5:56
Abhi Lahare8-Feb-10 5:56 
QuestionSetting the colour of a control item Pin
maycockt8-Feb-10 3:40
maycockt8-Feb-10 3:40 
AnswerRe: Setting the colour of a control item Pin
Richard MacCutchan8-Feb-10 3:53
mveRichard MacCutchan8-Feb-10 3:53 
AnswerRe: Setting the colour of a control item Pin
«_Superman_»8-Feb-10 5:10
professional«_Superman_»8-Feb-10 5:10 
AnswerRe: Setting the colour of a control item Pin
KingsGambit8-Feb-10 8:00
KingsGambit8-Feb-10 8:00 
QuestionHow to instance a class which name is in a string? Pin
transoft8-Feb-10 3:27
transoft8-Feb-10 3:27 
AnswerRe: How to instance a class which name is in a string? Pin
Hristo-Bojilov8-Feb-10 3:38
Hristo-Bojilov8-Feb-10 3:38 
GeneralRe: How to instance a class which name is in a string? Pin
transoft8-Feb-10 3:44
transoft8-Feb-10 3:44 
GeneralRe: How to instance a class which name is in a string? Pin
Cedric Moonen8-Feb-10 5:19
Cedric Moonen8-Feb-10 5:19 
GeneralRe: How to instance a class which name is in a string? Pin
ThatsAlok9-Feb-10 0:08
ThatsAlok9-Feb-10 0:08 

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.