Click here to Skip to main content
15,947,523 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rotating a shape within a bounding rect? Pin
Ryan Binns16-Jul-03 3:52
Ryan Binns16-Jul-03 3:52 
GeneralPipes and Child Process Pin
anqin15-Jul-03 7:26
anqin15-Jul-03 7:26 
GeneralDownload ActiveX Pin
Anonymous15-Jul-03 5:33
Anonymous15-Jul-03 5:33 
GeneralRe: Download ActiveX Pin
Iain Clarke, Warrior Programmer15-Jul-03 5:44
Iain Clarke, Warrior Programmer15-Jul-03 5:44 
GeneralRe: Download ActiveX Pin
Ryan Binns15-Jul-03 5:52
Ryan Binns15-Jul-03 5:52 
GeneralRe: Download ActiveX Pin
Iain Clarke, Warrior Programmer15-Jul-03 6:11
Iain Clarke, Warrior Programmer15-Jul-03 6:11 
GeneralRe: Download ActiveX Pin
Ryan Binns15-Jul-03 14:44
Ryan Binns15-Jul-03 14:44 
QuestionIs there any way to get this to work CString??? Pin
johnstonsk15-Jul-03 4:31
johnstonsk15-Jul-03 4:31 
I know I have been stuck on the same problem for the last few days but, I have to get this to work or my rpogram won't function correctly. Like I need it to.

I am using the getline() function to read in a file. I need to put the first word on each line in a char array.

	<br />
		string name, unit,min,max,value;	<br />
<br />
                for(int i=0; i<45; i++){<br />
			getline(fin, name, ',');<br />
			<br />
			if(name == "STOP")<br />
				break;<br />
			getline(fin, unit, ',');<br />
			getline(fin, min, ',');<br />
			getline(fin, max, ',');<br />
			getline(fin, value);<br />
			<br />
		    cout<<endl<<name<<"\n";<br />
			strcpy(TSimHeader_arr[0].Name, (char*)name.c_str());<br />
                        strcpy(TSimHeader_arr[0].Name, name); <br />
			strcpy(TSimHeader_arr[0].Name[i],name.c_str());<br />
			//strcpy(sHeader.Unit[i],unit.c_str()); <br />
			//(char)strcpy(TSimHeader_arr[0].Name[i], name);<br />
			//(char)strcpy(TSimHeader_arr[0].Unit[i], unit);<br />
			//TSimHeader_arr[0].Min[i]   =  atof(min.c_str());<br />
			//TSimHeader_arr[0].Max[i]   =  atof(max.c_str());<br />
		    TSimSignal_arr[0].Value[i] =  atof(value.c_str());<br />
			<br />
		<br />
			cout<<endl<<"names......."<<"\n"<<TSimHeader_arr[0].Name[i];<br />
			//printf("%s",TSimHeader_arr[0].Name[sig_count]);<br />
<br />
			<br />
			sig_count ++;<br />
		<br />
		}


All of the above are ways that I have tried. I don't get the correct word put in the char array.

I know the words are getting read in from the file correctly.

They are just not getting put in the char[] correctly.

Is there another way that I could go about doing this?
Is this the best wat to read in a file and put the words in a char[]?

I have to use a char[] because of certain requirements that my boss has given me.
I would love to use a vector, but it won't work

Thanks for your help,
Steven
AnswerRe: Is there any way to get this to work CString??? Pin
Ryan Binns15-Jul-03 5:05
Ryan Binns15-Jul-03 5:05 
GeneralRe: Is there any way to get this to work CString??? Pin
johnstonsk15-Jul-03 5:21
johnstonsk15-Jul-03 5:21 
GeneralRe: Is there any way to get this to work CString??? Pin
Ryan Binns15-Jul-03 5:48
Ryan Binns15-Jul-03 5:48 
GeneralRe: Is there any way to get this to work CString??? Pin
johnstonsk15-Jul-03 6:11
johnstonsk15-Jul-03 6:11 
GeneralRe: Is there any way to get this to work CString??? Pin
David Crow15-Jul-03 7:34
David Crow15-Jul-03 7:34 
GeneralRe: Is there any way to get this to work CString??? Pin
John M. Drescher15-Jul-03 7:59
John M. Drescher15-Jul-03 7:59 
GeneralRe: Is there any way to get this to work CString??? Pin
Ryan Binns15-Jul-03 14:40
Ryan Binns15-Jul-03 14:40 
GeneralRe: Is there any way to get this to work CString??? Pin
johnstonsk15-Jul-03 15:20
johnstonsk15-Jul-03 15:20 
AnswerRe: Is there any way to get this to work CString??? Pin
Shay Harel15-Jul-03 7:54
Shay Harel15-Jul-03 7:54 
AnswerRe: Is there any way to get this to work CString??? Pin
John M. Drescher15-Jul-03 8:03
John M. Drescher15-Jul-03 8:03 
GeneralRegistry values of an external PC Pin
Anonymous15-Jul-03 4:21
Anonymous15-Jul-03 4:21 
GeneralRe: Registry values of an external PC Pin
basementman15-Jul-03 4:27
basementman15-Jul-03 4:27 
GeneralAdjusting the overall contrast and brightness Pin
oliver.hu15-Jul-03 4:19
oliver.hu15-Jul-03 4:19 
GeneralRe: Adjusting the overall contrast and brightness Pin
Ryan Binns15-Jul-03 5:08
Ryan Binns15-Jul-03 5:08 
GeneralRe: Adjusting the overall contrast and brightness Pin
oliver.hu15-Jul-03 7:31
oliver.hu15-Jul-03 7:31 
GeneralRe: Adjusting the overall contrast and brightness Pin
John M. Drescher15-Jul-03 8:06
John M. Drescher15-Jul-03 8:06 
GeneralCreate CEdit dynamicly Pin
dzenan15-Jul-03 3:06
dzenan15-Jul-03 3:06 

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.