#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#define RANGE(i, min, max) (i<min) || (i>max) ? 1: 0
int main (void )
{
int r;
do
{
do{
r=rand();
} while (RANGE(r, 1, 100));
printf("%d", r);
}
while (!kbhit());
return 0;
}
When I run this programme I find the following error:
conio.h: No such file or directory
If delete #include "conio.h" then I find the following error:
Undefined symbols for architecture x86_64:
"_kbhit", referenced from:
_main in cckd1NC4.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
How can I solve this problem? What are reason behind these? Would you please tell me?
"conio.h"instead of<conio.h>? Ditto forstdio.handstdlib.h. - user554546#include "conio.h"rather than#include <conio.h>implies that you are supplying the header file rather than it being part of your compiler's libs. Are you supplying the header file? - David Heffernan