On Tue, 2007-11-13 at 18:41 -0800, Robert Ryan wrote: > allocate an int: int i =0; > initialize an int: int i = 5; > assign it to variable p1: p1 = 5;
I believe the allocation you mention is the variable definition. which provides enough information for compiler to allocation space for an object.Thus, int i; // allocation is done int i = 0; // both allocation and initialization there is another common term: declaration, which provides partial information to the compiler( correct me, not a good description). e,g extern int i; > or is it this: > > int i =new int[ ]; trying to allocation space for an int array???? strange!! int* i.... > int p1[5]; this does the allocation. > int* p1 = &p1[5]; allocate a space for an pointer and initialize it to p1. > > is this right > bob ryan > Correct me if I am wrong Wang Jun. > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. > Try it now. > > [Non-text portions of this message have been removed] > > > > >
