I'm using Cygwin with GCC, and ultimately I want to read in a file of characters into a vector of characters, and using this code
#include <fstream>#include <vector>#include <stdlib.h>using namespace std;int main (int argc, char *argv[] ){ vector<char> string1(); string1.push_back('a'); return 0;}
generates this compile time error:
main.cpp: In function
int main(int, char**)': main.cpp:46: error: request for member
push_back' instring1', which is of non -class type
std::vector > ()()'
I tried this with a vector of ints and strings as well and they had the same problem.