Click here to Skip to main content
15,889,852 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Combobox in DLL Pin
Anu_Bala3-Jan-10 16:43
Anu_Bala3-Jan-10 16:43 
GeneralRe: Combobox in DLL Pin
Richard MacCutchan3-Jan-10 22:05
mveRichard MacCutchan3-Jan-10 22:05 
GeneralRe: Combobox in DLL Pin
Anu_Bala3-Jan-10 23:17
Anu_Bala3-Jan-10 23:17 
GeneralRe: Combobox in DLL Pin
Richard MacCutchan3-Jan-10 23:40
mveRichard MacCutchan3-Jan-10 23:40 
GeneralRe: Combobox in DLL Pin
Anu_Bala4-Jan-10 0:49
Anu_Bala4-Jan-10 0:49 
GeneralRe: Combobox in DLL Pin
Richard MacCutchan4-Jan-10 1:01
mveRichard MacCutchan4-Jan-10 1:01 
AnswerRe: Combobox in DLL Pin
Tim Craig2-Jan-10 13:03
Tim Craig2-Jan-10 13:03 
QuestionRestricting rights to delete a dynamic array ? [modified] Pin
doug251-Jan-10 12:35
doug251-Jan-10 12:35 
Is there a way to declare a dynamic array in such a way so that it can't be deleted ?

What I'm actually trying to do is control access rights to an array returned by a function. I've basically managed to do what I meant but permission is still granted to deallocate memory for it, not that I/someone would do that because allocating memory for it is not allowed but it just seems improper for that access right to be granted when only the class it is a member of should be allowed to delete it.

The following code :

const int* const pMem = new int[5];

delete [] pMem;


is legal. Where as :

pMem = new int[5];


is not legal after declaration of pMem.

I don't imagine somebody would try to delete a const array but still, they can, so how can deletion be prevented ?

many thanks.

modified on Friday, January 1, 2010 7:10 PM

AnswerRe: Restricting rights to delete a dynamic array ? Pin
«_Superman_»1-Jan-10 14:33
professional«_Superman_»1-Jan-10 14:33 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug251-Jan-10 16:28
doug251-Jan-10 16:28 
AnswerRe: Restricting rights to delete a dynamic array ? Pin
Moak3-Jan-10 11:05
Moak3-Jan-10 11:05 
GeneralRe: Restricting rights to delete a dynamic array ? [modified] Pin
doug254-Jan-10 9:10
doug254-Jan-10 9:10 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
Moak4-Jan-10 12:01
Moak4-Jan-10 12:01 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug254-Jan-10 12:27
doug254-Jan-10 12:27 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug255-Jan-10 2:40
doug255-Jan-10 2:40 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
Moak5-Jan-10 3:41
Moak5-Jan-10 3:41 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug255-Jan-10 15:10
doug255-Jan-10 15:10 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug255-Jan-10 16:44
doug255-Jan-10 16:44 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
Moak5-Jan-10 23:16
Moak5-Jan-10 23:16 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug256-Jan-10 3:43
doug256-Jan-10 3:43 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
Moak6-Jan-10 12:51
Moak6-Jan-10 12:51 
GeneralRe: Restricting rights to delete a dynamic array ? [modified] Pin
doug256-Jan-10 16:14
doug256-Jan-10 16:14 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
Moak7-Jan-10 1:03
Moak7-Jan-10 1:03 
GeneralRe: Restricting rights to delete a dynamic array ? Pin
doug257-Jan-10 11:38
doug257-Jan-10 11:38 
Questioncommunication between objects Pin
Alex80gbg1-Jan-10 8:44
Alex80gbg1-Jan-10 8:44 

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.