I'm trying to create simple database engine. I have a problem with structures.
#include <iostream> #include <vector> #include <string> using namespace std; struct LICZBY { int wartosc; }; struct STUDENCI { int indeks; string imie; string nazwisko; }; struct PRZEDMIOTY { int id; string nazwa; // auto int semestr; // clamp (1/10) }; struct SALE { string nazwa; int rozmiar; // clamp (10/600) bool projektor; double powierzchnia; }; struct TABLES { vector<LICZBY> liczby; vector<STUDENCI> studenci; vector<PRZEDMIOTY> przedmioty; vector<SALE> sale; }; int main() { TABLES tables; tables.liczby.push_back({1}); cout << tables.liczby[0].wartosc; // your code goes here return 0; } I'm using Visual Studio 2012. This code return an error: expected an expression (here tables.liczby.push_back({1});), but code works at ideone.com. http://ideone.com/fork/zc9pz8
What is wrong? Please give me some advise.