vendredi 19 décembre 2014

I am still getting the error 'stoi' was not declared after I set my compiler setting to support c++11. Why?

This is my code



#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>

using namespace std;

int main(){
string humanNo;
int computerNo = 0;
do{
getline(cin,humanNo);
computerNo = stoi(humanNo);
}while(computerNo != 4);
}


I am trying to use stoi, stol to easily convert from string to integer in my CodeBlocks IDE. At first I learned that you have to first enable c++11 in the compiler settings. I enabled it but I am still getting the same error. Does anyone know what might be the problem I am encountering?


I am using MinGW compiler.


Aucun commentaire:

Enregistrer un commentaire