Thursday, July 30, 2009

How can I run my turbo C Program?

I have installed turbo C .


When I am compiling my program I am getting follwing Error.


I have written this code:





#include%26lt;stdio.h%26gt;


void main()


{


printf("Hello");


getch();


}





Now When I am compiling this code I am getting following three Errors.


Unable to open include file 'stdio.h'


function printf should have prototype.


function getch should have prototype.





Can u help me how I can solve it?


which type of setting is required?

How can I run my turbo C Program?
it means that you have not configured your directories correctly.


I think you've just copied it from some friend or other source.





here is the solution:


first, locate tc.exe which you run.


If you have a desktop shortcut, right-click, go to properties, go to "program" tab and get the path of TC.EXE


Make sure that folder containing the TC.EXE is placed in the root directory of your drive, i.e. D:\ or C:\ etc





open turbo c, go to options-%26gt;directores. In the first two fields, type the path of TC.EXE


(without ending backslash, i.e. if TC.EXE is located at D:\TURBOC3\TC.EXE then you have to type D:\TURBOC3 and not D:\TURBOC3\)





hit OK. now program should work.





Also i would recommend you to include conio.h also





#include%26lt;stdio.h%26gt;


#include%26lt;conio.h%26gt;





void main()


{


clrscr(); // Clear the screen, like cls in DOS


printf("Hello");


getch(); // Wait for a char


}
Reply:Hi,





The problem is ur Bin , Class file locations not in the proper location so only ur getting these errors.





Download and install TurboC from this below link, I tested it its working fine. http://www.escarsa.net.co/ftp/turboc/





Regards,


Murugesh


No comments:

Post a Comment