我想执行这段代码来运行自动任务调度,因为这段代码有两个错误。我无法弄清楚更正。
错误是“(在函数'main'中)”和“(赋值中的左值无效)”
#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;                      
}