Click here to Skip to main content
15,912,932 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Displaying WChar string in non-Unicode Project. Pin
Naveen17-Oct-07 5:15
Naveen17-Oct-07 5:15 
AnswerRe: Displaying WChar string in non-Unicode Project. Pin
Naveen17-Oct-07 5:17
Naveen17-Oct-07 5:17 
GeneralRe: Displaying WChar string in non-Unicode Project. Pin
nilesh.gawade17-Oct-07 17:37
nilesh.gawade17-Oct-07 17:37 
Questionincreasing the buffer allocatied for the application Pin
Kiran Pinjala15-Oct-07 21:44
Kiran Pinjala15-Oct-07 21:44 
QuestionRe: increasing the buffer allocatied for the application Pin
David Crow16-Oct-07 2:57
David Crow16-Oct-07 2:57 
AnswerRe: increasing the buffer allocatied for the application Pin
Kiran Pinjala16-Oct-07 19:09
Kiran Pinjala16-Oct-07 19:09 
GeneralRe: increasing the buffer allocatied for the application Pin
David Crow17-Oct-07 4:12
David Crow17-Oct-07 4:12 
QuestionMemory... [Solved] Pin
Rage15-Oct-07 21:15
professionalRage15-Oct-07 21:15 
Thanks everybody, but I solved it by doing ... nothing. After a while staring at the code, I hit ... Rebuild, and it worked like a charm. Ahhh VC++6 and templates Roll eyes | :rolleyes: Sorry for the hassle, thanks again for your answers.

-> Orignial post:

Here is my code:
// creation
	for(int i=0;i<3;i++)
	{
		BYTE *pbMessage= new BYTE[12];
		st.push(pbMessage);
	}

//deletion
	BYTE *pbTest;
	while(st.getSize()>0)
	{
		pbTest=st.pop();
		printf("%s\n",pbTest);
		delete[] pbTest;   /// <- Here an exception, shouldn't this work ?
	}


st is a sort of stack (which works). The push function saves the pointer, the pop function returns the pointer. How can I make the compiler understand that the pbTest points on 12 elements ?

BYTE pbTest[12];
pbTest=st.pop(); // does not work -> st.pop returns a BYTE*, pbTest is a BYTE[12]


Note that delete pbTest does not work either in the first example.

Thanks,




-- modified at 9:55 Tuesday 16th October, 2007

~RaGE();

I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

Do not feed the troll ! - Common proverb


AnswerRe: Memory... Pin
toxcct15-Oct-07 21:19
toxcct15-Oct-07 21:19 
QuestionRe: Memory... Pin
David Crow16-Oct-07 2:52
David Crow16-Oct-07 2:52 
AnswerRe: Memory... Pin
toxcct16-Oct-07 2:56
toxcct16-Oct-07 2:56 
GeneralRe: Memory... Pin
David Crow16-Oct-07 3:03
David Crow16-Oct-07 3:03 
AnswerRe: Memory... Pin
Nibu babu thomas15-Oct-07 21:37
Nibu babu thomas15-Oct-07 21:37 
AnswerRe: Memory... Pin
Roger Stoltz15-Oct-07 22:50
Roger Stoltz15-Oct-07 22:50 
GeneralRe: Memory... Pin
Matthew Faithfull15-Oct-07 23:49
Matthew Faithfull15-Oct-07 23:49 
GeneralRe: Memory... Pin
Rage16-Oct-07 3:55
professionalRage16-Oct-07 3:55 
GeneralRe: How to access all the Editboxes in a form. Pin
Hamid_RT15-Oct-07 20:45
Hamid_RT15-Oct-07 20:45 
GeneralRe: How to access all the Editboxes in a form. Pin
CodingLover15-Oct-07 21:00
CodingLover15-Oct-07 21:00 
GeneralRe: How to access all the Editboxes in a form. Pin
Hamid_RT16-Oct-07 0:38
Hamid_RT16-Oct-07 0:38 
Questiondisplaying the files and folders in a list box Pin
Chandrasekharan P15-Oct-07 20:42
Chandrasekharan P15-Oct-07 20:42 
AnswerRe: displaying the files and folders in a list box Pin
Hamid_RT15-Oct-07 20:47
Hamid_RT15-Oct-07 20:47 
GeneralRe: displaying the files and folders in a list box Pin
Chandrasekharan P15-Oct-07 22:10
Chandrasekharan P15-Oct-07 22:10 
GeneralRe: displaying the files and folders in a list box Pin
Hamid_RT16-Oct-07 0:36
Hamid_RT16-Oct-07 0:36 
AnswerRe: displaying the files and folders in a list box Pin
Nelek15-Oct-07 20:47
protectorNelek15-Oct-07 20:47 
GeneralRe: displaying the files and folders in a list box Pin
David Crow16-Oct-07 2:55
David Crow16-Oct-07 2:55 

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.