atoi 함수관련
세이
-
아 제가 지금 atoi함수를 쓸려고하는데 계속 오류가뜨네요 타입오류라면서 이거 어찌된거죠?
제가 무엇을 잘못했나요?
소스 올립니다.
#include fstream
#include cstdlib
#include iostream
using namespace std;
char buf[4];
int v1,v2,v3,v4,d,e;
int main()
{ ifstream infile(INPUT.TXT);
if(!infile){ //파일을 열지 못할 때를 대비한 if문.
cout파일을 열 수 없습니다!endl; //cout는 헤더파일 iostream 안의 객체.
return 1;
}
char* v1are ;
v1are = buf[0];
char* v2are ;
v2are = buf[1];
char* v3are ;
v3are = buf[2];
char* v4are ;
v4are = buf[3];
while(infilebuf)
{
v1 = atoi( static_castchar*(v1are) );
v4= atoi( static_castchar*(v4are) );
v3= atoi( static_castchar*(v3are) );
v2= atoi( static_castchar*(v2are) );
cout v1;
}
infile.close();
d= v4/60; e=v4%60; v3=e;
if (v3 = 60)
{
v3=0;
v2+1;
} v2+d;
if(v2=60)
{
v2=0;
v1+1;
}
ofstream outfile(OUTPUT.TXT);
outfile v1\tv2\tv3;return 0;
제가 빨리 써아되는데 일요일부터 이러고있네요^^