#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <stdlib.h>
using namespace std;
•
• //main func declaration etc...
•
//Vectors for storing information from file
vector<string> include;
vector<string> exclude;
string temp; //for storing whatever the stream is on
int len = atoi(puzzle_file >> temp); //first pos
int width = atoi(puzzle_file >> temp); //second pos
위의 코드는 파일을 읽고 해당 int에 숫자를 저장합니다. 나는 내 파일 헤더에 사용법 #include < \ cstdlib> 및 사용법 #include < \ stdlib.h>에도 불구하고, " 'atoi 함수'에 대한 호출에 대한 일치 기능"말한다 오류 받고 있어요. 여기에서 어디로 가야할지 모릅니다. stackoverflow 및 기타 포럼에 대한 연구가 실제로 도움이되는 것을 찾지 못했습니다. 어떤 충고? 당신은 stoi 대신 atoi 사용해야합니다 감사합니다atoi()가 예상대로 작동하지 않습니다.
는 [mcve] 게시하시기 바랍니다. –
'c_str()는'그것이 얼굴을 제출 서버가 완벽하게 호환되지 않기 때문에 우리는 C++ 11 사용하지 않는 것이 좋습니다 .. 내 수업에 대한 –