Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[OOP c++] practical use cases of cross casting Pin
elgaabeb7-Nov-11 6:19
elgaabeb7-Nov-11 6:19 
AnswerRe: [OOP c++] practical use cases of cross casting REPOST Pin
Richard MacCutchan7-Nov-11 7:43
mveRichard MacCutchan7-Nov-11 7:43 
GeneralRe: [OOP c++] practical use cases of cross casting REPOST Pin
Albert Holguin7-Nov-11 8:01
professionalAlbert Holguin7-Nov-11 8:01 
GeneralRe: [OOP c++] practical use cases of cross casting REPOST Pin
elgaabeb7-Nov-11 22:33
elgaabeb7-Nov-11 22:33 
GeneralRe: [OOP c++] practical use cases of cross casting REPOST Pin
Richard MacCutchan7-Nov-11 23:27
mveRichard MacCutchan7-Nov-11 23:27 
GeneralRe: [OOP c++] practical use cases of cross casting REPOST Pin
elgaabeb7-Nov-11 23:35
elgaabeb7-Nov-11 23:35 
Questionmaking a unsigned char array gives a buffer overrun error Pin
VCProgrammer6-Nov-11 17:45
VCProgrammer6-Nov-11 17:45 
AnswerRe: making a unsigned char array gives a buffer overrun error Pin
Chuck O'Toole6-Nov-11 18:13
Chuck O'Toole6-Nov-11 18:13 
Well, your stack is only so big and if you are declaring stack based (local variable) arrays of that size, it's no wonder you got a stack overflow. And while it is possible to enlarge the stack (Project Properties, Stack Size[^]), I wouldn't recommend that.

Instead, you should use new or malloc to dynamically create the array from the larger "heap" pool. You can look up those functions on MSDN if you are unfamiliar with them.

(PS, if you new something, remember to delete it when you are done with it, otherwize you will have a memory leak and eventually you will not be able to repeat the dynamic allocation. If you use malloc instead, you will need to use free to return the memory to the pool.)
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Luc Pattyn6-Nov-11 23:04
sitebuilderLuc Pattyn6-Nov-11 23:04 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric7-Nov-11 6:57
Erudite_Eric7-Nov-11 6:57 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin7-Nov-11 7:18
professionalAlbert Holguin7-Nov-11 7:18 
AnswerRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric7-Nov-11 6:56
Erudite_Eric7-Nov-11 6:56 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin7-Nov-11 7:17
professionalAlbert Holguin7-Nov-11 7:17 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Chuck O'Toole7-Nov-11 7:22
Chuck O'Toole7-Nov-11 7:22 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin7-Nov-11 7:23
professionalAlbert Holguin7-Nov-11 7:23 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric7-Nov-11 7:41
Erudite_Eric7-Nov-11 7:41 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin7-Nov-11 7:45
professionalAlbert Holguin7-Nov-11 7:45 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric7-Nov-11 8:05
Erudite_Eric7-Nov-11 8:05 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin7-Nov-11 8:24
professionalAlbert Holguin7-Nov-11 8:24 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric7-Nov-11 20:57
Erudite_Eric7-Nov-11 20:57 
AnswerRe: making a unsigned char array gives a buffer overrun error Pin
Chuck O'Toole8-Nov-11 2:04
Chuck O'Toole8-Nov-11 2:04 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric8-Nov-11 22:02
Erudite_Eric8-Nov-11 22:02 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Albert Holguin9-Nov-11 4:03
professionalAlbert Holguin9-Nov-11 4:03 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Chuck O'Toole9-Nov-11 4:16
Chuck O'Toole9-Nov-11 4:16 
GeneralRe: making a unsigned char array gives a buffer overrun error Pin
Erudite_Eric9-Nov-11 22:50
Erudite_Eric9-Nov-11 22:50 

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.