Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LINK:fatal erro LNK1104: can not open file "C:\Program.obj" Pin
Rajesh match3-Nov-03 21:23
Rajesh match3-Nov-03 21:23 
GeneralQuestion for Multi Monitor setting Pin
w_yufeng3-Nov-03 17:38
w_yufeng3-Nov-03 17:38 
GeneralRe: Question for Multi Monitor setting Pin
w_yufeng3-Nov-03 17:43
w_yufeng3-Nov-03 17:43 
Generaldocking a modeless dialog Pin
novachen3-Nov-03 16:53
novachen3-Nov-03 16:53 
GeneralRe: docking a modeless dialog Pin
souldog3-Nov-03 18:35
souldog3-Nov-03 18:35 
GeneralRe: docking a modeless dialog Pin
novachen4-Nov-03 1:22
novachen4-Nov-03 1:22 
GeneralGetting available space in window Pin
FearlessBurner4-Nov-03 2:22
FearlessBurner4-Nov-03 2:22 
QuestionI can't even display the file to screen? Pin
Link26003-Nov-03 16:26
Link26003-Nov-03 16:26 
I'm writing a program that open a text file, then display only the
first 4 lines and the last 4 lines to screen. <this is="" a="" win32="" console=""
program="">

However, I can't even open a file to display to the screen??? What's
wrong?


Please help.

<br />
<br />
void display_file()<br />
{<br />
	<br />
	ifstream ins;<br />
	ofstream outs;<br />
	string inFile;<br />
	<br />
		cout << "Please Enter the file name: " << endl;<br />
		cin >> inFile;<br />
		ins.open(inFile.c_str());<br />
		if (ins.fail())<br />
		{<br />
			ins.clear();	<br />
			cout << "*** ERROR: Can not open file " << endl;<br />
		}<br />
                // To read each of the file stream into string object<br />
		string line;<br />
		int lineCount = 0;<br />
		getline(ins, line);<br />
		while (line.length() != 0)<br />
		{<br />
			lineCount++;<br />
			outs << line << endl;<br />
			getline(ins, line);<br />
		}<br />
	<br />
<br />
}<br />

AnswerRe: I can't even display the file to screen? Pin
Link26003-Nov-03 16:51
Link26003-Nov-03 16:51 
GeneralRe: I can't even display the file to screen? Pin
ZoogieZork3-Nov-03 18:05
ZoogieZork3-Nov-03 18:05 
GeneralRe: I can't even display the file to screen? Pin
Link26003-Nov-03 18:49
Link26003-Nov-03 18:49 
GeneralAlgorithm? Pin
wogerdoger4-Nov-03 5:03
wogerdoger4-Nov-03 5:03 
Generalheight of the header of window Pin
novachen3-Nov-03 16:01
novachen3-Nov-03 16:01 
GeneralRe: height of the header of window Pin
souldog3-Nov-03 18:37
souldog3-Nov-03 18:37 
GeneralRe: height of the header of window Pin
Michael Dunn3-Nov-03 19:14
sitebuilderMichael Dunn3-Nov-03 19:14 
Questiondoes control have contextmenu? Pin
chriss_rook3-Nov-03 13:52
chriss_rook3-Nov-03 13:52 
AnswerRe: does control have contextmenu? Pin
cmk3-Nov-03 23:20
cmk3-Nov-03 23:20 
QuestionHow to Duplicate a Printer Pin
Paul Farry3-Nov-03 13:46
professionalPaul Farry3-Nov-03 13:46 
QuestionHow can my window under any other application window? Pin
golden06063-Nov-03 13:32
golden06063-Nov-03 13:32 
QuestionHow do you use MM_ISOTROPIC mode with a CScrollView? Pin
cdsmith3-Nov-03 11:56
cdsmith3-Nov-03 11:56 
AnswerRe: How do you use MM_ISOTROPIC mode with a CScrollView? Pin
souldog3-Nov-03 18:42
souldog3-Nov-03 18:42 
GeneralXP and Single Instance; Pin
Bo Hunter3-Nov-03 11:54
Bo Hunter3-Nov-03 11:54 
GeneralRe: XP and Single Instance; Pin
Anthony_Yio3-Nov-03 19:24
Anthony_Yio3-Nov-03 19:24 
QuestionMaximum Ethernet Cards and IPs per Card? Pin
dafunkt3-Nov-03 8:54
dafunkt3-Nov-03 8:54 
AnswerRe: Maximum Ethernet Cards and IPs per Card? Pin
Jeryth3-Nov-03 10:27
Jeryth3-Nov-03 10:27 

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.