当我在C ++中使用stoi
函数时出现此错误:
[错误]'stoi'未在此范围内声明
#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;
}