#include<iostream>
#include <string.h>
#include <fstream>
#include <stdio.h>
#include <vector>
#include <conio.h>
using namespace std;
class Vector{
private:
float *f;
int *number;
public:
void show( ){
cout<<"Element of the vector:"<<this->f<<endl;
cout<<"Number of this element:"<<this->number<<endl;
}
void printMenu() {
cout << "\n1.\t INITIALIZE vector ";
cout << "\n2.\t DELETE vector ";
cout << "\n3.\t SET size of vector ";
cout << "\n4.\t CAHNGE size of vector";
cout << "\n4.\t FIND node";
cout << "\n4.\t NUMBER of nodes in vector";
cout << "Your choice: ";
}
void init(Vector *v, int el){
float tmp;
int count=0;
cout<<"Enter element of vector "<<endl;
cin>>tmp;
this->f=&tmp;
count++;
this->number=&count;
}
void showAll(Vector *v, int el){
for (int i;i<el; i++){
v[i].show();
cout<<endl;
}
}
};
int main(){
int n,choice = 0,num;
float value;
Vector *A;
cout<<"How many vectors?: "<<endl;
cin>>n;
A = new Vector [n];
if ( A == NULL ) {
printf("ERROR");
return 1;
delete A;}
Vector array[n];
while (1) {
system ("cls");
array[n].printMenu();
printf("\nYour choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
for(int i=0; i<n;i++){
cout<<"Enter number of nodes for vector number"<<i+1<< ":"<<endl;
cin>>num;
for (int j=0;j<num;j++){
array[i].init(array,num);
} array[n].showAll(array,num);
}
break;
case 2:
array[n].showAll(array,num);
getch();
break;
}
}}