Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIE web browswer bug Pin
Jim Crafton29-Oct-04 10:54
Jim Crafton29-Oct-04 10:54 
GeneralRe: IE web browswer bug Pin
Jim Crafton29-Oct-04 11:38
Jim Crafton29-Oct-04 11:38 
Questiongetchar() ? Pin
Kuniva29-Oct-04 9:42
Kuniva29-Oct-04 9:42 
AnswerRe: getchar() ? Pin
David Crow29-Oct-04 10:50
David Crow29-Oct-04 10:50 
GeneralRe: getchar() ? Pin
Kuniva31-Oct-04 5:17
Kuniva31-Oct-04 5:17 
GeneralRe: getchar() ? Pin
David Crow1-Nov-04 2:12
David Crow1-Nov-04 2:12 
GeneralRe: getchar() ? Pin
Kuniva1-Nov-04 8:03
Kuniva1-Nov-04 8:03 
AnswerRe: getchar() ? Pin
Andrew Peace31-Oct-04 3:29
Andrew Peace31-Oct-04 3:29 
The problem here is that you've allocated a char array of size 21, i.e. with subscripts 0 to 20. Then, you're accepting input of length up to 20 characters, to fill the array you created. This is where the problem occurs, because in actual fact you should only be accepting 19 characters of input, since the twentieth needs to be the NULL string terminator. To clarify, note that str[21] is NOT inside the bounds of the array.

Hope this helps,

--
Andrew.
GeneralRe: getchar() ? Pin
Kuniva31-Oct-04 5:22
Kuniva31-Oct-04 5:22 
GeneralNVM Pin
Kuniva31-Oct-04 5:28
Kuniva31-Oct-04 5:28 
GeneralCreating A New Font Pin
Leyu29-Oct-04 9:29
Leyu29-Oct-04 9:29 
QuestionHow to get untransparent area (RECT) of icon? Pin
dido2k29-Oct-04 8:38
dido2k29-Oct-04 8:38 
GeneralBITMAPINFO &bmInfo = *(LPBITMAPINFO)hDIB Variable Declarations for bmInfo!!! Pin
lewislewis_lewis29-Oct-04 7:02
lewislewis_lewis29-Oct-04 7:02 
GeneralRe: BITMAPINFO &bmInfo = *(LPBITMAPINFO)hDIB Variable Declarations for bmInfo!!! Pin
dido2k29-Oct-04 8:33
dido2k29-Oct-04 8:33 
GeneralMFC Date option Pin
missnazar29-Oct-04 6:10
missnazar29-Oct-04 6:10 
GeneralRe: MFC Date option Pin
BlackDice29-Oct-04 6:19
BlackDice29-Oct-04 6:19 
GeneralMFC type of file Pin
missnazar29-Oct-04 6:05
missnazar29-Oct-04 6:05 
GeneralRe: MFC type of file Pin
John M. Drescher29-Oct-04 6:06
John M. Drescher29-Oct-04 6:06 
GeneralRe: MFC type of file Pin
missnazar29-Oct-04 6:21
missnazar29-Oct-04 6:21 
GeneralRe: MFC type of file Pin
Maximilien29-Oct-04 7:38
Maximilien29-Oct-04 7:38 
GeneralRe: MFC type of file Pin
alex.barylski29-Oct-04 14:13
alex.barylski29-Oct-04 14:13 
GeneralThread message queue Pin
GingerSpen29-Oct-04 6:01
GingerSpen29-Oct-04 6:01 
GeneralRe: Thread message queue Pin
Michael Dunn29-Oct-04 6:58
sitebuilderMichael Dunn29-Oct-04 6:58 
GeneralRe: Thread message queue Pin
GingerSpen29-Oct-04 7:36
GingerSpen29-Oct-04 7:36 
GeneralRe: Thread message queue Pin
GKarRacer29-Oct-04 7:03
GKarRacer29-Oct-04 7:03 

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.