Hi . I created a class and in main program i use a vector like this .
how can i Access to class method in main program ?????
class AAA
{
private:
int a
public:
int getA() { return a ;}
};
int main()
{
vector<AAA>* test= new vector<AAA>();
Hi .first tnx for help . i created this class , but when i want to show output my program show just last item ....
#include<iostream>
#include<string>
#include<vector>
using namespace std;
class Driver
{
private:
string name;
int main()
{
const int size = 2;
Driver dri;
vector<Driver>* driver = new vector<Driver>();
for ( int i = 0 ; i < size ; i++)
dri.setDriver();
driver->push_back(dri);
for ( int i = 0 ; i < driver->size(); i++)
{
driver->at(i).getDriver();