mercredi 11 octobre 2017

Code::Blocks MinGW C++11 error: 'stof' is not a member of 'std'

I am using Code::Blocks with MinGW (GCC version 4.9.2) and have the -std=c++11 flag enabled in compiler settings, but if I try to build this code it keeps telling me that stof was not declared in this scope..

If I use stf::stof the error is: 'stof' is not a member of 'std'

#include<iostream>
#include<string>

int main(){
    float a = stof("625.5");
}

Do I need to enable the c++11 flag somewhere else or what can be the problem?

enter image description here enter image description here

Aucun commentaire:

Enregistrer un commentaire