Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalserveral radio buttons groups on the same dialog Pin
Broker200313-Apr-03 22:36
Broker200313-Apr-03 22:36 
GeneralRe: serveral radio buttons groups on the same dialog Pin
Iain Clarke, Warrior Programmer13-Apr-03 22:48
Iain Clarke, Warrior Programmer13-Apr-03 22:48 
GeneralRe: serveral radio buttons groups on the same dialog Pin
Broker200313-Apr-03 22:56
Broker200313-Apr-03 22:56 
Questiona doubt ? Pin
Anonymous13-Apr-03 22:32
Anonymous13-Apr-03 22:32 
AnswerRe: a doubt ? Pin
Xander8013-Apr-03 22:41
Xander8013-Apr-03 22:41 
GeneralRe: a doubt ? Pin
Anonymous13-Apr-03 22:47
Anonymous13-Apr-03 22:47 
GeneralRe: a doubt ? Pin
Joaquín M López Muñoz13-Apr-03 22:54
Joaquín M López Muñoz13-Apr-03 22:54 
GeneralRe: a doubt ? Pin
Iain Clarke, Warrior Programmer13-Apr-03 22:55
Iain Clarke, Warrior Programmer13-Apr-03 22:55 
"var=NULL" is NOT the same as "delete var".

If you imagine that
BYTE *var= new BYTE [100]<pre>
allocates a lump of memory for your use (it may be longer than 100 bytes long) and sets 
var to point to it.

<pre>var=NULL;

simply makes your variable point "nowhere". The memory is still allocated.
delete [] var;

frees the memory, but your variable is still pointing to the now freed patch or memory.
You could still use it, but not safely. Note the [] in the delete command as you
are freeing an array.

You should be doing something like:
BYTE *var = new BYTE [100];    // Allocate some short term memory

...                            // Use it for some purpose

delete [] var;                 // "give it back"
var = NULL;                    // Forget about it so we don't use it my mistake.


Pointers are one of those things you struggle with for a while then wake up one morning
going "Ahah!"

Iain.
GeneralThanks [a doubt ?] Pin
Anonymous13-Apr-03 23:02
Anonymous13-Apr-03 23:02 
GeneralQuestion about raw socket and TCP. Pin
George213-Apr-03 22:10
George213-Apr-03 22:10 
GeneralCDialog - change title Pin
LittleYellowBird13-Apr-03 21:55
LittleYellowBird13-Apr-03 21:55 
GeneralRe: CDialog - change title Pin
Taka Muraoka13-Apr-03 22:09
Taka Muraoka13-Apr-03 22:09 
GeneralRe: CDialog - change title Pin
Cedric Moonen13-Apr-03 22:10
Cedric Moonen13-Apr-03 22:10 
GeneralRe: CDialog - change title Pin
peterchen13-Apr-03 22:12
peterchen13-Apr-03 22:12 
GeneralRe: CDialog - change title Pin
Rage13-Apr-03 22:12
professionalRage13-Apr-03 22:12 
GeneralRe: CDialog - change title Pin
LittleYellowBird13-Apr-03 22:22
LittleYellowBird13-Apr-03 22:22 
Generalprogramm crashes wenn retrieving a CString Pin
Willem B13-Apr-03 21:28
Willem B13-Apr-03 21:28 
GeneralRe: programm crashes wenn retrieving a CString Pin
Joaquín M López Muñoz13-Apr-03 23:03
Joaquín M López Muñoz13-Apr-03 23:03 
GeneralRe: programm crashes wenn retrieving a CString Pin
Willem B13-Apr-03 23:13
Willem B13-Apr-03 23:13 
GeneralRe: programm crashes wenn retrieving a CString Pin
Willem B13-Apr-03 23:16
Willem B13-Apr-03 23:16 
GeneralRe: programm crashes wenn retrieving a CString Pin
Willem B13-Apr-03 23:19
Willem B13-Apr-03 23:19 
GeneralRe: programm crashes wenn retrieving a CString Pin
Iain Clarke, Warrior Programmer13-Apr-03 23:07
Iain Clarke, Warrior Programmer13-Apr-03 23:07 
GeneralMy app. under Win98? Problem with DLL's Pin
whofmans13-Apr-03 20:40
whofmans13-Apr-03 20:40 
GeneralRe: My app. under Win98? Problem with DLL's Pin
Tal Rasha's Guardianship13-Apr-03 20:46
Tal Rasha's Guardianship13-Apr-03 20:46 
GeneralRe: My app. under Win98? Problem with DLL's Pin
whofmans13-Apr-03 21:13
whofmans13-Apr-03 21:13 

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.