Question is very easy but i forgot to use c++ and don't know where else to ask.

I have question regarding vectors in c++: when i make vector with objects and when i try to push\_back new object on vector i get some wierd error. Can u help me and say how should i use push\_back (on object?) so it works. Thanks!

I have .h class:

```
class x{
    public:
        x();

        double cpuGHz;
        int hddGB;
        char brand[25];
};

and have main class:

#include "Racunalo.h"

#include <iostream>
#include <cstdlib>
#include <string.h>
#include <vector>

using namespace std;

int main()
{

    int n,i;

    double cpu;
    int hdd;
    char bra[25];
    vector<Racunalo> vec;

    Racunalo rac;

    cin >> n;

    for (i=0; i<n; i++)
        {
            cin >> bra;
            cin >> hdd;
            cin >> cpu;

            strcpy(rac.brand, bra);
            rac.hddGB = hdd;
            rac.cpuGHz = cpu;

            vec[i].push_back(rac); // this line is "rotten"
        }

```