so recently i set up a VM and installed VS2012 Professional and my c++ code is not working on this one
But on the local machine ive written this C++ code on VS2013 for windows desktop Express
#include<iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
ofstream myfile;
myfile.open("example1.csv");
vector<int> cats;
cats = { 1, 2, 3, 4, 5 };
sort(cats.begin(), cats.end());
do {
for (int j = 0; j<cats.size(); j++){
cout << cats[j] << ',';
myfile << cats[j] << ',';
}
cout << endl;
myfile << endl;
} while (next_permutation(cats.begin(), cats.end()));
myfile.close();
return 0;
}
this basically should just get me the permutation of the vector declared but im getting this error in VS2012 Pro
-error C2059: syntax error: '{'
-error C2143: syntax error: missing ';' before '{'
-error C2143: syntax error: missing ';' before '}'
-IntelliSence: expected an expression
-warning C4018 '<':signed/unsigned mismatch