#include "TIntV.h" using namespace dstructs; int main() { TIntV vec; // Create an empty vector of integers vec.Add(10); // Add element 10 to the vector vec.Add(20); // Add element 20 to the vector cout << "Vector size: " << vec.Len() << endl; cout << "Element at index 1: " << vec[1] << endl; vec.Del(0); // Remove first element from the vector cout << "New vector size: " << vec.Len() << endl; cout << "Element at index 0: " << vec[0] << endl; return 0; }
#include "TIntV.h" using namespace dstructs; int main() { TIntV vec; for(int i=0; i<1000000; i++) vec.Add(i); cout << "Vector size: " << vec.Len() << endl; cout << "Element at index 100: " << vec[100] << endl; cout << "Element at index 1000: " << vec[1000] << endl; return 0; }This code creates a vector of integers using the "TIntV" class and adds 1 million elements to the vector using a for loop. The program then prints the size of the vector and the elements at index 100 and 1000. Overall, the "TIntV" class is a useful tool in C++ programming for maintaining dynamic lists of integer values. It is part of the "libdstructs" package library.