Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Communicating with top level form from child forms Pin
Hamid_RT17-Jul-06 19:29
Hamid_RT17-Jul-06 19:29 
GeneralRe: Communicating with top level form from child forms Pin
mrhonus18-Jul-06 5:58
mrhonus18-Jul-06 5:58 
QuestionDialog Based ActiveX Control Pin
MissingLinkError17-Jul-06 7:41
MissingLinkError17-Jul-06 7:41 
AnswerRe: Dialog Based ActiveX Control Pin
nguyenvhn17-Jul-06 15:49
nguyenvhn17-Jul-06 15:49 
QuestionDoing print abort with a toolbar button Pin
CodeBrain17-Jul-06 6:40
CodeBrain17-Jul-06 6:40 
AnswerRe: Doing print abort with a toolbar button Pin
led mike17-Jul-06 7:08
led mike17-Jul-06 7:08 
GeneralRe: Doing print abort with a toolbar button Pin
CodeBrain17-Jul-06 8:42
CodeBrain17-Jul-06 8:42 
Questionfstream - reading from a text file Pin
jon-8017-Jul-06 6:28
professionaljon-8017-Jul-06 6:28 
Why is it not compiling?
Errors:
1. (16): error C2079: 'file_op' uses undefined class 'std::basic_fstream<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
2. (16): error C2078: too many initializers
3. (17): error C2228: left of '.eof' must have class/struct/union type

4. ..test.cpp(17): fatal error C1903: unable to recover from previous error(s); stopping compilation


test.cpp

#define MAX_LINES_PER_SENTENCE 1000

#include ".\SentenceAr.h"
#include ".\SentenceList.h"
#include <string>

using namespace std;

void main ()
{

char strOutput[MAX_LINES_PER_SENTENCE + 1] = {""};
char strFileToRead[MAX_LINES_PER_SENTENCE + 1] = {"C:\\temp\\testfile.txt"};
int x = NULL;

fstream file_op(strFileToRead,ios::in);
while(!file_op.eof())
{
file_op.getline(strFileToRead,2000);
cout <<strOutput;
} file_op.close();
cout <<endl;
;

file_op.close();

}

The code does not compile even when I try to declare strOutput and strFileToRead as 'string' including the <string>.

Confused | :confused:

Jon
AnswerRe: fstream - reading from a text file Pin
Cedric Moonen17-Jul-06 6:35
Cedric Moonen17-Jul-06 6:35 
AnswerRe: fstream - reading from a text file Pin
toxcct17-Jul-06 6:36
toxcct17-Jul-06 6:36 
QuestionHow to get data in a grid control of a property page to another property page Pin
vc++_fragrance17-Jul-06 6:25
vc++_fragrance17-Jul-06 6:25 
QuestionAlways Show Button on Foreground Pin
Vaibhavsh8317-Jul-06 6:24
Vaibhavsh8317-Jul-06 6:24 
AnswerRe: Always Show Button on Foreground Pin
PJ Arends17-Jul-06 19:42
professionalPJ Arends17-Jul-06 19:42 
Questionhow to pass value to MFC exe Pin
maharaja pandian17-Jul-06 6:00
maharaja pandian17-Jul-06 6:00 
AnswerRe: how to pass value to MFC exe Pin
Cedric Moonen17-Jul-06 6:37
Cedric Moonen17-Jul-06 6:37 
GeneralRe: how to pass value to MFC exe Pin
maharaja pandian17-Jul-06 19:26
maharaja pandian17-Jul-06 19:26 
AnswerRe: how to pass value to MFC exe Pin
David Crow17-Jul-06 6:47
David Crow17-Jul-06 6:47 
GeneralRe: how to pass value to MFC exe Pin
maharaja pandian17-Jul-06 19:28
maharaja pandian17-Jul-06 19:28 
QuestionRe: how to pass value to MFC exe Pin
David Crow18-Jul-06 2:36
David Crow18-Jul-06 2:36 
AnswerRe: how to pass value to MFC exe Pin
William.Wang17-Jul-06 16:20
William.Wang17-Jul-06 16:20 
GeneralRe: how to pass value to MFC exe Pin
maharaja pandian17-Jul-06 19:29
maharaja pandian17-Jul-06 19:29 
Questionhow to pass value to MFC exe from a dll Pin
maharaja pandian17-Jul-06 5:59
maharaja pandian17-Jul-06 5:59 
AnswerRe: how to pass value to MFC exe from a dll Pin
led mike17-Jul-06 7:12
led mike17-Jul-06 7:12 
QuestionAnimateWindow with controls on window Pin
hell_admin17-Jul-06 5:11
hell_admin17-Jul-06 5:11 
GeneralC++ style casting Pin
Rob Caldecott17-Jul-06 5:11
Rob Caldecott17-Jul-06 5:11 

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.