Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionResource handle Pin
Vinod CS26-Oct-07 21:04
Vinod CS26-Oct-07 21:04 
AnswerRe: Resource handle Pin
Paresh Chitte28-Oct-07 19:24
Paresh Chitte28-Oct-07 19:24 
QuestionAccesing operator from parent class Pin
Fernando A. Gomez F.26-Oct-07 18:03
Fernando A. Gomez F.26-Oct-07 18:03 
AnswerRe: Accesing operator from parent class [modified] Pin
Hamed Musavi27-Oct-07 0:05
Hamed Musavi27-Oct-07 0:05 
GeneralRe: Accesing operator from parent class Pin
Fernando A. Gomez F.27-Oct-07 13:28
Fernando A. Gomez F.27-Oct-07 13:28 
GeneralRe: Accesing operator from parent class Pin
Hamed Musavi27-Oct-07 20:34
Hamed Musavi27-Oct-07 20:34 
GeneralRe: Accesing operator from parent class Pin
Fernando A. Gomez F.27-Oct-07 22:08
Fernando A. Gomez F.27-Oct-07 22:08 
GeneralRe: Accesing operator from parent class Pin
Hamed Musavi28-Oct-07 3:16
Hamed Musavi28-Oct-07 3:16 
Questionhow to get Domain Role Pin
HOW WHAT26-Oct-07 14:33
HOW WHAT26-Oct-07 14:33 
AnswerRe: how to get Domain Role Pin
David Crow29-Oct-07 4:20
David Crow29-Oct-07 4:20 
QuestionCAsyncSocket and Message Pump Pin
Don Rolando26-Oct-07 10:30
Don Rolando26-Oct-07 10:30 
AnswerRe: CAsyncSocket and Message Pump Pin
Mark Salsbery26-Oct-07 12:10
Mark Salsbery26-Oct-07 12:10 
GeneralRe: CAsyncSocket and Message Pump Pin
Don Rolando26-Oct-07 20:20
Don Rolando26-Oct-07 20:20 
GeneralRe: CAsyncSocket and Message Pump [modified] Pin
Don Rolando26-Oct-07 21:51
Don Rolando26-Oct-07 21:51 
GeneralRe: CAsyncSocket and Message Pump Pin
Mark Salsbery27-Oct-07 6:57
Mark Salsbery27-Oct-07 6:57 
GeneralRe: CAsyncSocket and Message Pump Pin
Moak8-Nov-07 12:03
Moak8-Nov-07 12:03 
GeneralRe: CAsyncSocket and Message Pump Pin
Blake Miller20-Nov-07 6:53
Blake Miller20-Nov-07 6:53 
QuestionCHtmlView - how to get session Pin
m1m226-Oct-07 8:49
m1m226-Oct-07 8:49 
QuestionProgram terminates Pin
pourang26-Oct-07 8:28
pourang26-Oct-07 8:28 
#include<iostream>
using namespace std;

int main()
{
cout << " please choise one of these lables: " << endl << endl;
cout << " c)Carnivore p) Pianist " << endl << endl;
cout << " t)Tree g) Game ";

char ch;
cin >> ch;

while ( ch != 'c' && ch != 'p' && ch != 't' && ch != 'g' )
{
cout << " Please enter C,p,t,g " << endl << endl;
cin >> ch;
}

switch (ch)
{

case 'c' : cout << "A cat is a carnivore.\n";
break;
case 'p' : cout << "Radu Lupu is a pianist.\n";
break;
case 't' : cout << "A maple is a tree.\n";
break;
case 'g' : cout << "Golf is a game.\n";
break;
default : cout << "The program shouldn't get here!\n";
}


cin.get();
cin.get();

return 0;
}



You see!? every time you enter a number the while loop does his job and prompt the message:

" Please enter C,p,t,g ". But when i type a uppercase like G or D program terminates.

Whay while loop doesn't prompt the message?




int life()
{
in a land with no bird, no spring. My first journey was a
return 0;
}

AnswerRe: Program terminates [modified] Pin
Chris Losinger26-Oct-07 8:31
professionalChris Losinger26-Oct-07 8:31 
GeneralRe: Program terminates Pin
pourang26-Oct-07 8:34
pourang26-Oct-07 8:34 
GeneralRe: Program terminates Pin
pourang26-Oct-07 8:36
pourang26-Oct-07 8:36 
QuestionRe: Program terminates Pin
David Crow26-Oct-07 8:37
David Crow26-Oct-07 8:37 
AnswerRe: Program terminates Pin
Chris Losinger26-Oct-07 9:10
professionalChris Losinger26-Oct-07 9:10 
QuestionCWinApp::OnIdle problem?? Pin
SandipG 26-Oct-07 8:01
SandipG 26-Oct-07 8:01 

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.