Click here to Skip to main content
14,365,441 members

C / C++ / MFC

 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 9:09
memberVictor Nijegorodov19-Sep-19 9:09 
SuggestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 10:29
memberDavid Crow19-Sep-19 10:29 
QuestionDetermining length of Switch compare Pin
ForNow18-Sep-19 16:45
memberForNow18-Sep-19 16:45 
AnswerRe: Determining length of Switch compare Pin
Peter_in_278018-Sep-19 17:49
professionalPeter_in_278018-Sep-19 17:49 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
memberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Richard MacCutchan18-Sep-19 21:55
protectorRichard MacCutchan18-Sep-19 21:55 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
memberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Stefan_Lang19-Sep-19 3:23
memberStefan_Lang19-Sep-19 3:23 
(short) is just a type cast. All it does is tell the compiler to interpret the value as a different type. The value in this case is just the single character itshort[0]. What you intended to do was something dofferent: you wanted the computer to reinterpret the memory starting at itshort[0]. But there is no way for the compiler to understand that is what you want.

As others pointed out, there are ways to achieve this. However, why don't you simple use short or unsigned short?
typedef short itshort;
If you don't trust the compiler to use 16 bit values for short, you can also use size-specific types. E. g. Microsoft offers __int8, __int16, etc. for these purposes. See __int8, __int16, __int32, __int64 | Microsoft Docs[^]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 5:06
memberForNow19-Sep-19 5:06 
AnswerRe: Determining length of Switch compare Pin
leon de boer19-Sep-19 5:38
memberleon de boer19-Sep-19 5:38 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 6:11
memberForNow19-Sep-19 6:11 
GeneralRe: Determining length of Switch compare Pin
leon de boer28-Sep-19 15:57
memberleon de boer28-Sep-19 15:57 
QuestionC++ string assignment to struct Pin
Fotsing18-Sep-19 12:54
memberFotsing18-Sep-19 12:54 
AnswerRe: C++ string assignment to struct Pin
Richard MacCutchan18-Sep-19 21:26
protectorRichard MacCutchan18-Sep-19 21:26 
GeneralRe: C++ string assignment to struct Pin
Fotsing18-Sep-19 23:33
memberFotsing18-Sep-19 23:33 
GeneralRe: C++ string assignment to struct Pin
Stefan_Lang19-Sep-19 3:12
memberStefan_Lang19-Sep-19 3:12 
GeneralRe: C++ string assignment to struct Pin
Fotsing19-Sep-19 14:06
memberFotsing19-Sep-19 14:06 
AnswerRe: C++ string assignment to struct Pin
Victor Nijegorodov18-Sep-19 21:30
memberVictor Nijegorodov18-Sep-19 21:30 
GeneralRe: C++ string assignment to struct Pin
Fotsing18-Sep-19 23:28
memberFotsing18-Sep-19 23:28 
AnswerRe: C++ string assignment to struct Pin
CPallini18-Sep-19 22:01
mveCPallini18-Sep-19 22:01 
QuestionMFC VC++ Pin
Member 1457555617-Sep-19 21:42
memberMember 1457555617-Sep-19 21:42 
AnswerRe: MFC VC++ Pin
Victor Nijegorodov17-Sep-19 21:59
memberVictor Nijegorodov17-Sep-19 21:59 
GeneralRe: MFC VC++ Pin
Member 1457555617-Sep-19 22:06
memberMember 1457555617-Sep-19 22:06 
GeneralRe: MFC VC++ Pin
Victor Nijegorodov17-Sep-19 22:43
memberVictor Nijegorodov17-Sep-19 22:43 
GeneralRe: MFC VC++ Pin
Member 1457555618-Sep-19 0:35
memberMember 1457555618-Sep-19 0:35 

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.