错误“[错误]'stoi'未在此范围内声明”

时间:2017-11-10 13:22:06

标签: c++

当我在C ++中使用stoi函数时出现此错误:

  

[错误]'stoi'未在此范围内声明

enter image description here

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;

int main()
{

string nicNo;
cout << "Enter your NIC Number"<<endl<<endl;
cin >> nicNo;

cout << "Your Birth Year is 19" <<nicNo.substr(0,2 ) << endl; 

nicNo = nicNo.substr(3, 3);
cout << nicNo;


 int var = stoi(nicNo);
 int day;

if(day>500)
{
    cout<< "male";`enter code here`
}

return 0;
}

0 个答案:

没有答案