Click here to Skip to main content
15,921,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: EnableMenu() not working Pin
Member 19839859-Jun-05 15:18
Member 19839859-Jun-05 15:18 
GeneralRe: EnableMenu() not working Pin
Christian Graus9-Jun-05 15:29
protectorChristian Graus9-Jun-05 15:29 
GeneralCPropTree usage Pin
CodeGoose9-Jun-05 11:17
CodeGoose9-Jun-05 11:17 
Generalaccess data in dialog from win32 application Pin
asdeshmukh9-Jun-05 11:10
asdeshmukh9-Jun-05 11:10 
GeneralRe: access data in dialog from win32 application Pin
Tom Archer9-Jun-05 16:24
Tom Archer9-Jun-05 16:24 
QuestionCommented data file? Pin
knapak9-Jun-05 9:36
knapak9-Jun-05 9:36 
AnswerRe: Commented data file? Pin
Christian Graus9-Jun-05 12:40
protectorChristian Graus9-Jun-05 12:40 
GeneralRe: Commented data file? Pin
knapak9-Jun-05 13:12
knapak9-Jun-05 13:12 
uh... either I didn't make myself clear or I didn't understand your response. Of course I know that INSIDE THE CODE I can use // or /*...*/. The question is how do I comment in a file to be read by the program, making the program ignore the comment... just the same as in the code but while reading the file. Say I have the following code:

int main()<br />
{<br />
	int id;<br />
	double Stuff;<br />
	ifstream GetData;<br />
	GetData.open("D:\\SSL\\Code\\Testing_Rutines\\FileComms\\comms.dat");<br />
	if (! GetData.is_open())<br />
	{ cout << "Error opening data file" << endl; exit (1); }<br />
	else cout << "Commented file opened" << endl;<br />
<br />
	while(!GetData.eof())<br />
	{<br />
		GetData  >> id >>  Stuff;<br />
		cout << id << Stuff;<br />
	}<br />
	GetData.close();<br />
<br />
	return 0;<br />
}<br />


And the data file has (with comments):

// first
1 2.3
// second
2 3.5
// third
3 9.8

where the program needs to ignore "// first" , "// second" and "// third".

If your response is that I need to "define a character sequence to indicate a comment" I have absolutely no idea how to do it. Both // and /*...*/ are already defined in C++ as comments inside the code, I don't have to define anything.

Thank you!
GeneralRe: Commented data file? Pin
Christian Graus9-Jun-05 13:16
protectorChristian Graus9-Jun-05 13:16 
GeneralRe: Commented data file? Pin
knapak9-Jun-05 13:27
knapak9-Jun-05 13:27 
GeneralRe: Commented data file? Pin
Christian Graus9-Jun-05 13:28
protectorChristian Graus9-Jun-05 13:28 
GeneralRe: Commented data file? Pin
Tom Archer9-Jun-05 16:11
Tom Archer9-Jun-05 16:11 
Generaldir work CDatabase and CFileDialog Pin
Pasquale829-Jun-05 9:17
Pasquale829-Jun-05 9:17 
GeneralRe: dir work CDatabase and CFileDialog Pin
Tom Archer9-Jun-05 16:15
Tom Archer9-Jun-05 16:15 
GeneralMaking a C++ DLL to be used form VB - Static Question Pin
CimTaurus9-Jun-05 9:15
CimTaurus9-Jun-05 9:15 
GeneralRe: Making a C++ DLL to be used form VB - Static Question Pin
Chris Losinger9-Jun-05 9:47
professionalChris Losinger9-Jun-05 9:47 
GeneralCDO/MAPI sending problem Pin
vineas9-Jun-05 8:43
vineas9-Jun-05 8:43 
Generalloading a bitmap from file Pin
bkphat9-Jun-05 8:37
bkphat9-Jun-05 8:37 
GeneralRe: loading a bitmap from file Pin
Dominik Reichl9-Jun-05 8:48
Dominik Reichl9-Jun-05 8:48 
GeneralRe: loading a bitmap from file Pin
Budric B.9-Jun-05 8:51
Budric B.9-Jun-05 8:51 
Questionhow to count print outs Pin
Ajay Nikam9-Jun-05 8:14
Ajay Nikam9-Jun-05 8:14 
GeneralGet the path to MS Office Pin
Nitron9-Jun-05 8:12
Nitron9-Jun-05 8:12 
GeneralRe: Get the path to MS Office Pin
Kappy9-Jun-05 10:49
Kappy9-Jun-05 10:49 
GeneralRe: Get the path to MS Office Pin
Tom Archer9-Jun-05 16:18
Tom Archer9-Jun-05 16:18 
GeneralRe: Get the path to MS Office Pin
Nitron10-Jun-05 2:42
Nitron10-Jun-05 2:42 

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.