Click here to Skip to main content
15,904,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CFileDialog problem with Vista Pin
Paresh Chitte16-Apr-07 21:38
Paresh Chitte16-Apr-07 21:38 
QuestionHow to gray a Tab in TabCtrl? Pin
narayanagvs16-Apr-07 20:22
narayanagvs16-Apr-07 20:22 
AnswerRe: How to gray a Tab in TabCtrl? Pin
prasad_som16-Apr-07 21:04
prasad_som16-Apr-07 21:04 
QuestionCode-Page? Pin
John R. Shaw16-Apr-07 17:50
John R. Shaw16-Apr-07 17:50 
AnswerRe: Code-Page? Pin
markkuk17-Apr-07 1:58
markkuk17-Apr-07 1:58 
GeneralRe: Code-Page? Pin
John R. Shaw17-Apr-07 4:51
John R. Shaw17-Apr-07 4:51 
QuestionRe: Code-Page? Pin
David Crow17-Apr-07 4:59
David Crow17-Apr-07 4:59 
AnswerRe: Code-Page? Pin
John R. Shaw17-Apr-07 6:33
John R. Shaw17-Apr-07 6:33 
QuestionCTreeCtrl Problem Pin
_anil_16-Apr-07 17:49
_anil_16-Apr-07 17:49 
AnswerRe: CTreeCtrl Problem Pin
aquawicket16-Apr-07 18:03
aquawicket16-Apr-07 18:03 
GeneralRe: CTreeCtrl Problem Pin
_anil_16-Apr-07 18:07
_anil_16-Apr-07 18:07 
GeneralRe: CTreeCtrl Problem Pin
Michael Dunn16-Apr-07 18:25
sitebuilderMichael Dunn16-Apr-07 18:25 
GeneralRe: CTreeCtrl Problem Pin
Parthi_Appu16-Apr-07 18:26
Parthi_Appu16-Apr-07 18:26 
AnswerRe: CTreeCtrl Problem Pin
syampj16-Apr-07 20:47
syampj16-Apr-07 20:47 
AnswerRe: CTreeCtrl Problem Pin
skornel17-Apr-07 2:27
skornel17-Apr-07 2:27 
QuestionNot access to child dialog object... Assert Error.. Pin
aquawicket16-Apr-07 16:59
aquawicket16-Apr-07 16:59 
AnswerRe: Not access to child dialog object... Assert Error.. Pin
aquawicket16-Apr-07 17:32
aquawicket16-Apr-07 17:32 
Questioncrypto and stego..? Pin
Software_Specialist16-Apr-07 13:11
Software_Specialist16-Apr-07 13:11 
AnswerRe: crypto and stego..? Pin
Dmitry Khudorozhkov16-Apr-07 14:37
Dmitry Khudorozhkov16-Apr-07 14:37 
Questiongetline help Pin
arbster116-Apr-07 10:56
arbster116-Apr-07 10:56 
Hello everybody, I'm writing a program to take the contents for several .txt files and make them into one single .txt file. The separate txt files have to go in the single file at a certain order.
The problem with the code (see below) is that when I call getline(file,bline), bline is left empty after the call I don't understand what could be the problem. The file opens properly according to file.is_open but getline doesn't read. Here is the code:

<br />
<br />
	fstream file;<br />
	<br />
	string bline;<br />
	int i,j;<br />
	<br />
	<br />
	string month[]={"01","02","03","04","05","06","07","08","09","10","11","12"};//these are all the months in the files<br />
	string year[]={"1999","2000","2001","2002","2003","2004","2005","2006"};//and these are all the years<br />
	<br />
          for(j=0;j<=7;j++)<br />
		for(i=0;i<=11;i++)<br />
		{<br />
			string fname="E:\\Month\\"+month[i]+"_"+year[j]+".txt";<br />
			<br />
			file.open(fname.c_str());<br />
			if(file.is_open()){<br />
				<br />
				while(!file.eof()){<br />
					ofstream ofile;<br />
					ofile.open("C://allfile.txt",ios::app);<br />
					getline(file,bline);<br />
					ofile<<year[j]<<'\t'<<month[i]<<'\t'<<bline<<endl;<br />
				}<br />
			<br />
				cout<<"Finished month "<<i+1<<" year "<<j+1999<<endl;<br />
<br />
			}<br />
			else<br />
				cout<<"Cant open file"<<endl;<br />
<br />
			<br />
		}<br />

AnswerRe: getline help Pin
toxcct16-Apr-07 11:08
toxcct16-Apr-07 11:08 
GeneralRe: getline help Pin
arbster116-Apr-07 11:10
arbster116-Apr-07 11:10 
GeneralRe: getline help Pin
toxcct16-Apr-07 11:14
toxcct16-Apr-07 11:14 
AnswerRe: getline help Pin
Stephen Hewitt16-Apr-07 18:08
Stephen Hewitt16-Apr-07 18:08 
GeneralRe: getline help Pin
toxcct16-Apr-07 20:28
toxcct16-Apr-07 20:28 

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.