0

c++ error : function 'delay' should have a prototype

I am using turboC 3.0 compiler and creating some program where some graphics are used. so the things is if the file format of the program is .c then there is no errors, and if file format is .cpp it is showing the error of function should return a prototype. i search something on google about that and the user defined functions prototype is declared before the main() and they are not showing errors now. but the delay() is showing errors so how to fix it plz help. and the following header files are involved for .cpp :- #include<stdio.h> #include<stdlib.h> #include<graphics.h> #include<conio.h> #include<iostream.h>

13th Jan 2020, 10:37 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar
2 Réponses
+ 9
Try using #include<dos.h> as delay function is defined inside the dos.h header file
13th Jan 2020, 10:59 AM
Nova
Nova - avatar
+ 1
Thank you Nova that worked. I know i am missing some header files.
13th Jan 2020, 11:07 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar