Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WM_KEYDOWN Pin
ThatsAlok15-Apr-05 21:20
ThatsAlok15-Apr-05 21:20 
GeneralRe: WM_KEYDOWN Pin
22491716-Apr-05 1:49
22491716-Apr-05 1:49 
GeneralRe: WM_KEYDOWN Pin
ThatsAlok17-Apr-05 18:53
ThatsAlok17-Apr-05 18:53 
GeneralRe: WM_KEYDOWN Pin
ThatsAlok15-Apr-05 20:55
ThatsAlok15-Apr-05 20:55 
GeneralReading blank lines Pin
nilkn15-Apr-05 18:00
sussnilkn15-Apr-05 18:00 
GeneralRe: Reading blank lines Pin
ThatsAlok15-Apr-05 18:11
ThatsAlok15-Apr-05 18:11 
GeneralRe: Reading blank lines Pin
eli1502197916-Apr-05 0:03
eli1502197916-Apr-05 0:03 
GeneralRe: Reading blank lines Pin
nilkn16-Apr-05 5:40
sussnilkn16-Apr-05 5:40 
Thanks. That helped some, but I'm still not sure how to do it. I'm fairly experienced with C++, I've just literally haven't ever used standard file input and output interface, so I'm really pretty stumped. Here's the code for the parser (note this isn't the only code I've written though, I have a lot more that's not the parser):

CompanySetVector CompanySets = CompanySetVector();
ifstream InputFile ("company.in");
ofstream OutputFile("company.out");

string A, B;
float cAB;
int CurrSet = 0;

CompanySets.push_back(new CompanySet);

InputFile >> A;
while (A != "*") {

if (InputFile.peek() == '\n') {

CompanySets.push_back(new CompanySet);
CurrSet++;
}

InputFile >> B;

CompanyDef* pA = CompanySets[CurrSet]->second[A];
CompanyDef* pB = CompanySets[CurrSet]->second[B];

if (pA == NULL) {

CompanySets[CurrSet]->second[A] = new CompanyDef(A);
pA = CompanySets[CurrSet]->second[A];
}

if (pB == NULL) {

CompanySets[CurrSet]->second[B] = new CompanyDef(B);
pB = CompanySets[CurrSet]->second[B];
}

InputFile >> cAB;

ControllingInterest* ci = new ControllingInterest;
ci->first = pB;
ci->second = cAB;
pA->ControllingInterests[B] = ci;

InputFile >> A;
}

Most of that code is pretty project specific an irrelevant to you.

Notice the line:

if (InputFile.peek() == '\n') ...

This is where I need to see if the line is blank. I thought using peek would work, but it doesnt Frown | :(

Do you guys have any other suggestions? Again, thanks for taking time to read this!
GeneralRe: Reading blank lines Pin
eli1502197916-Apr-05 20:45
eli1502197916-Apr-05 20:45 
GeneralRe: Reading blank lines Pin
ng kok chuan17-Apr-05 15:23
ng kok chuan17-Apr-05 15:23 
GeneralNon-trivial Image Display Pin
LighthouseJ15-Apr-05 12:55
LighthouseJ15-Apr-05 12:55 
GeneralShared Memory Residue Pin
Grahamfff15-Apr-05 11:44
Grahamfff15-Apr-05 11:44 
GeneralC++ Interop Debugger Issue Pin
Chip Patton15-Apr-05 11:37
Chip Patton15-Apr-05 11:37 
GeneralHID class Pin
trupgmtuf15-Apr-05 11:13
susstrupgmtuf15-Apr-05 11:13 
GeneralMenu Item capture Pin
Al_Pennyworth15-Apr-05 10:35
Al_Pennyworth15-Apr-05 10:35 
GeneralRe: Menu Item capture Pin
Ravi Bhavnani15-Apr-05 10:49
professionalRavi Bhavnani15-Apr-05 10:49 
GeneralRe: Menu Item capture Pin
Al_Pennyworth15-Apr-05 11:45
Al_Pennyworth15-Apr-05 11:45 
GeneralRe: Menu Item capture Pin
Ravi Bhavnani15-Apr-05 11:57
professionalRavi Bhavnani15-Apr-05 11:57 
GeneralRe: Menu Item capture Pin
liquid_15-Apr-05 21:21
liquid_15-Apr-05 21:21 
GeneralCHTMLView again Pin
#realJSOP15-Apr-05 9:58
professional#realJSOP15-Apr-05 9:58 
GeneralRe: CHTMLView again Pin
Ravi Bhavnani15-Apr-05 10:55
professionalRavi Bhavnani15-Apr-05 10:55 
GeneralRe: CHTMLView again Pin
dabs15-Apr-05 15:34
dabs15-Apr-05 15:34 
GeneralChange Colour of CEdit on Dialog Bar Pin
Cliff Hatch15-Apr-05 9:52
Cliff Hatch15-Apr-05 9:52 
GeneralRe: Change Colour of CEdit on Dialog Bar Pin
Jack Puppy15-Apr-05 13:43
Jack Puppy15-Apr-05 13:43 
GeneralRe: Change Colour of CEdit on Dialog Bar Pin
Cliff Hatch16-Apr-05 2:07
Cliff Hatch16-Apr-05 2:07 

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.