Is it a question?!

X

xhzeng

I don't decide it, and I need help.

Q:
const int* pInt = new int(0);
delete pInt;
 
T

tom_usenet

I don't decide it, and I need help.

Q:
const int* pInt = new int(0);
delete pInt;
A:
c:\Dev\test\dotnettest\dotnettest\dotnettest.cpp(2) : error C2059:
syntax error : 'delete'

Tom
 
R

Rolf Magnus

xhzeng said:
I don't decide it, and I need help.

You don't decide what?
Q:
const int* pInt = new int(0);
delete pInt;

This is a piece of code. Not a valid C++ program, but might be valid as
part of one.
But what is the question?
 
M

Michael Kochetkov

xhzeng said:
I don't decide it, and I need help.

Q:
const int* pInt = new int(0);
delete pInt;
No, it is not. It is not a question. Even
const int* const i = new int(0);
delete i;
is not a question because destructors are allowed to run for const objects
too.
 
A

Andrey Tarasevich

xhzeng said:
I don't decide it, and I need help.

Q:
const int* pInt = new int(0);
delete pInt;

It is just a fragment of valid C++ code. Now, what is the question and
what is it that you "don't decide"?
 
U

Unforgiven

xhzeng said:
I don't decide it, and I need help.

Q:
const int* pInt = new int(0);
delete pInt;

You ran this trough an Internet translator, something like Altavista
Babelfish, I suspect? Unfortunately, none of us can really make out what the
question you have is. Perhaps you would be better of finding help on a forum
where they speak your language.
 
P

Peter van Merkerk

I don't decide it, and I need help.
Says who?

IIRC MSVC 6 doesn't allow deleting const pointers, even though according
to the standard it should.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top