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

C / C++ / MFC

 
AnswerRe: how can i specify the path Pin
Madhu Nair1-Jul-09 23:20
Madhu Nair1-Jul-09 23:20 
AnswerRe: how can i specify the path Pin
Chandrasekharan P1-Jul-09 23:21
Chandrasekharan P1-Jul-09 23:21 
AnswerRe: how can i specify the path Pin
Michael Haephrati2-Dec-16 5:40
professionalMichael Haephrati2-Dec-16 5:40 
QuestionCharts and Diagrams with C++? Pin
bosfan1-Jul-09 22:54
bosfan1-Jul-09 22:54 
AnswerRe: Charts and Diagrams with C++? Pin
CPallini1-Jul-09 23:13
mveCPallini1-Jul-09 23:13 
AnswerRe: Charts and Diagrams with C++? Pin
kilt2-Jul-09 2:47
kilt2-Jul-09 2:47 
QuestionC++ interview question Pin
minkowski1-Jul-09 21:51
minkowski1-Jul-09 21:51 
AnswerRe: C++ interview question Pin
Cedric Moonen1-Jul-09 22:02
Cedric Moonen1-Jul-09 22:02 
minkowski wrote:
nextChar() != '\0'


This part of the code actually "returns" something (true or false). You then assign the result of the comparison into the ch variable. true is usually 1 and false is 0. So, your character will contain either 0 or 1. If you try to ouptut as it is (so, without the casting to an integer), you will end up printing the character whose value is 0 or 1 (so, not printable character), that's why you need to cast it to an integer.

I guess that having a body for your function was not really important for the interview question: they simply have a function that returns a character...

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

GeneralRe: C++ interview question Pin
minkowski1-Jul-09 22:17
minkowski1-Jul-09 22:17 
GeneralRe: C++ interview question Pin
CPallini1-Jul-09 22:19
mveCPallini1-Jul-09 22:19 
AnswerRe: C++ interview question Pin
_AnsHUMAN_ 1-Jul-09 22:04
_AnsHUMAN_ 1-Jul-09 22:04 
GeneralRe: C++ interview question Pin
molesworth1-Jul-09 22:32
molesworth1-Jul-09 22:32 
GeneralRe: C++ interview question Pin
minkowski1-Jul-09 22:37
minkowski1-Jul-09 22:37 
GeneralRe: C++ interview question Pin
molesworth1-Jul-09 23:35
molesworth1-Jul-09 23:35 
AnswerRe: C++ interview question Pin
CPallini1-Jul-09 22:14
mveCPallini1-Jul-09 22:14 
JokeRe: C++ interview question Pin
toxcct1-Jul-09 22:57
toxcct1-Jul-09 22:57 
GeneralRe: C++ interview question Pin
minkowski1-Jul-09 23:10
minkowski1-Jul-09 23:10 
GeneralRe: C++ interview question Pin
CPallini1-Jul-09 23:15
mveCPallini1-Jul-09 23:15 
GeneralRe: C++ interview question Pin
UserNameless1-Jul-09 23:30
UserNameless1-Jul-09 23:30 
GeneralRe: C++ interview question Pin
CPallini1-Jul-09 23:42
mveCPallini1-Jul-09 23:42 
GeneralRe: C++ interview question Pin
minkowski2-Jul-09 1:43
minkowski2-Jul-09 1:43 
AnswerRe: C++ interview question Pin
«_Superman_»1-Jul-09 22:15
professional«_Superman_»1-Jul-09 22:15 
Question[Message Deleted] Pin
npbzy1-Jul-09 21:13
npbzy1-Jul-09 21:13 
AnswerRe: Need help in C++ progamming to output measurement automatically after manually defined points Pin
CPallini1-Jul-09 21:25
mveCPallini1-Jul-09 21:25 
General[Message Deleted] Pin
npbzy1-Jul-09 22:12
npbzy1-Jul-09 22:12 

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.