thankyou heeps jj1814, my modified if statement now looks like this and it works:
if((argv[1] !=NULL) && (strcmp(argv[1], "-l") == 0))
{
printf("output:");
printf("TASK-NO\tDATE\tTIME\tTASK DESCRIPTION");
return(0);
}
here is the basic while loop that I'm working with that I need the Ctrl-d to exit from
while (1 == 1)
{
now=time(0);
ptr=localtime(&now);
lDay = ptr->tm_mday;
lMonth = ptr->tm_mon + 1;
lYear = ptr->tm_year + 1900;
lHour = ptr->tm_hour;
lMinute = ptr->tm_min;
printf("%u/%u/%u|%u:%u>> ",lDay, lMonth, lYear, lHour, lMinute);
gets(strDescription);
fprintf(theDatafile,"%u/%u/%u|%u:%u|%s\n",lDay, lMonth, lYear, lHour, lMinute, &strDescription);
printf("\nTask Added:\t\"%s\"\n", &strDescription);
}
what would I use to get ctrl-d to exit that loop, and where would I use it (exactly) it really has to be around the gets() section, cause that is where the user is prompted for input.