Click here to Skip to main content
15,882,017 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:21
CaptainSeeSharp30-Oct-09 19:21 
AnswerRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:37
LunaticFringe30-Oct-09 19:37 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:41
CaptainSeeSharp30-Oct-09 19:41 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
N a v a n e e t h30-Oct-09 19:46
N a v a n e e t h30-Oct-09 19:46 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:48
CaptainSeeSharp30-Oct-09 19:48 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:47
LunaticFringe30-Oct-09 19:47 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:50
CaptainSeeSharp30-Oct-09 19:50 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:55
LunaticFringe30-Oct-09 19:55 
Well, there is, and char is (god, I'm rusty on stuff like this) typedef'd to a byte - it IS a byte. And that was the trouble - the variables only allowed for one byte of storage, so it stuck one byte into each, not realizing you'd intended to enter a multi-byte response into a single variable.

Your fix is appropriate, methinks - the variables probably should have been shorts or ints to begin with.

Big Grin | :-D
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 20:02
CaptainSeeSharp30-Oct-09 20:02 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 20:14
LunaticFringe30-Oct-09 20:14 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
Randor 30-Oct-09 22:31
professional Randor 30-Oct-09 22:31 
QuestionLPCSTR and char* issues Pin
MbHimself30-Oct-09 17:34
MbHimself30-Oct-09 17:34 
AnswerRe: LPCSTR and char* issues [modified] Pin
LunaticFringe30-Oct-09 18:46
LunaticFringe30-Oct-09 18:46 
GeneralRe: LPCSTR and char* issues Pin
MbHimself30-Oct-09 19:09
MbHimself30-Oct-09 19:09 
GeneralRe: LPCSTR and char* issues Pin
LunaticFringe30-Oct-09 19:42
LunaticFringe30-Oct-09 19:42 
AnswerRe: LPCSTR and char* issues Pin
«_Superman_»30-Oct-09 19:40
professional«_Superman_»30-Oct-09 19:40 
Questionhow to use a matrix associeted to control variables ? Pin
timbk30-Oct-09 13:32
timbk30-Oct-09 13:32 
AnswerRe: how to use a matrix associeted to control variables ? Pin
«_Superman_»30-Oct-09 15:55
professional«_Superman_»30-Oct-09 15:55 
Questiondll linking Pin
rahul116730-Oct-09 6:31
rahul116730-Oct-09 6:31 
AnswerRe: dll linking Pin
Richard MacCutchan30-Oct-09 6:55
mveRichard MacCutchan30-Oct-09 6:55 
QuestionRe: dll linking Pin
David Crow30-Oct-09 7:42
David Crow30-Oct-09 7:42 
AnswerRe: dll linking Pin
rahul116730-Oct-09 20:26
rahul116730-Oct-09 20:26 
GeneralRe: dll linking Pin
Cedric Moonen30-Oct-09 23:25
Cedric Moonen30-Oct-09 23:25 
GeneralRe: dll linking Pin
David Crow2-Nov-09 3:35
David Crow2-Nov-09 3:35 
QuestionProblem while using CComBSTR Pin
Rahul Vaishnav30-Oct-09 5:37
Rahul Vaishnav30-Oct-09 5:37 

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.