이 코드는 두 가지 오류가 있으므로 자동 작업 스케줄링을 실행하려면이 코드를 실행하고 싶습니다. 나는 정정을 알아낼 수 없다.작업 일정에 관한 코드
오류는 당신이 ... "(함수에서 '주')"
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
int main()
{
char *timetoken;
char currtime[7];
char schedtime[9];
int i;
struct tm *localtimeptr;
strcpy(schedtime,"15:25:00");
while(true)
{
time_t lt;
sleep(1);
time(<);
localtimeptr = localtime(<);
timetoken=strtok(asctime(localtimeptr)," ");
for(i=1;i<5;i++)
timetoken=strtok(NULL," ");
if(i==3)
{
strcpy(currtime,timetoken);
}
}
printf("The current time is: %s\n",currtime);
printf("We are waiting for: %s\n",schedtime);
if(!strcmp(currtime,schedtime))
{
printf("Time to do stuff \n");
system("ROBOCOPY C:\\oslab E:\\BACKUP /e/mir/np /log:backup_log.txt");
}
getch();
return 0;
}
있는 행에 오류 등이 줄 뭔가를 의미? –
@OliCharlesworth : 18 번째 줄에 오류가 있습니다. – scheduling
무엇을 시도 했습니까? 예를 들어, lvalue가 무엇인지에 대해 배우고 오류가 발생한 행에서 lvalue로 사용중인 것을 판별하고 유효한 lvalue인지 여부를 고려 했습니까? 또한 코드를 올바르게 포맷하십시오. –