how to use new at tnt library.

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

 



Dear All,

Hello,

thank you for the ppl that help me before , i have a another question.

i don't know if this the better place to ask this, if anyone know a better 
place , let me know.thank you.

i try to use a new at tnt library ,like a iint , here are example:

#include <iostream>
using namespace std;

int  main () {

int how;

cin >> how;		
  int * lalo;
  lalo = new int [how];
  lalo[2] = 8 ;
  cout << "lalo[0]" << lalo[0] << endl;
  cout << "lalo[2]" << lalo[2] << endl;

return 0;

}

this is a int new allocation regular use, this working without 
problems,but:

#include <iostream>
using namespace std;
#include "include/tnt.h"
using namespace TNT;

int  main () {

  Array1D < int> * lala;
  int how;

  cin >> how;
  lala = new Array1D <int> (how);// i tryed with () and [] , but the in 
			//example write to use () to allocation.
 lala[2] = 8;
 cout << "lala[0]" << lala[0]<< endl;
 cout << "lala[2]" << lala[2]<< endl;

return 0;

}

anyone have any ideia?

thank you very much to all.

marcelo


[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