I'm attempting to prompt the user to input the amount of time they want the program to wait. However, when I compile the program, it produces the forllowing warning:
warning: assignment makes integer from pointer without a cast
The warnings references the following line:
y = sleeptime;
I don't quite understand this as there aren't any pointers in my program.
Thanks in advance.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int sleeptime(void)
{
int x;
x = 0;
printf("How long would you like to wait?\n");
scanf("%d", &x);
return x;
}
int main(void)
{
int y;
y = 0;
y = sleeptime;
sleep(y);
return 0;
}