Re: how to use new at tnt library.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

On Tue, Oct 19, 2004 at 08:54:34AM -0500, Eljay Love-Jensen wrote:
> Hi Marcelo,
> 
> I'm not familiar with the TNT library you're using.
> 
> If the Array1D<how>(int) constructor creates what I presume it's creating, 
> it should work.  But I'm making presumptions that may be .
> 
> --Eljay
 
I presume it's creating an object with array semantics of the given dimension 
which stores int values to which you hold a *pointer*. 

If you want to access that object you have to dereference that pointer of course:

  (*lala)[2] = 8;
  cout << "lala[0]" << (*lala)[0]<< endl;
  cout << "lala[2]" << (*lala)[2]<< endl;

And don't forget to "delete" the object.

-- 
Claudio

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux