HELP ! with C++

Joined
Oct 10, 2006
Messages
3
Reaction score
0
I got few C++ questions:

1)
--
NULL vs (int *)0
what's the difference between:
Code:
 int *i = NULL
and
Code:
 int *i = (int *)0

compilignnng a code with int*i = NULL gives me:
Code:
In function `int main()':
error: `NULL' undeclared (first use this function)
error: (Each undeclared identifier is reported only once for each function it appears in.)

what causes this ?

2)
--
Why the following doesnt cause error:
Code:
int *i = (int *)0;
delete i;

3)
--
What's the difference between:
Code:
int * array = new int[100];
and
Code:
int array[100]

Thanx for the help
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top