first program in C

how to run first program in Turbo c

Page 1 of 1

3 Replies - 1228 Views - Last Post: 22 December 2010 - 08:15 AM Rate Topic: -----

#1 Guest_Sara*


Reputation:

first program in C

Posted 22 December 2010 - 08:05 AM

I am a beginner for C language!
I've just downloaded turboc. I wrote a simple program in that but i get 4 errors which are listed below:
1- Unable to open include file 'stdio.h'
2- Unable to open include file 'conio.h'
3- function printf should have a prototype.
4- function getch should have a prototype.

When I tried to get help by F2 it shows that
The compiler could not find the named file.
You do not have files set in config.sys on your root directory.
Verify that named file exists.
Set files=20 in config.sys

I tried to search for config.sys directory but failed. How to fix this problem.
My program is as below;

#include<stdio.h>
#include<conio.h>
void main()
{
printf("HelloWorld!");
getch();
}


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 22 December 2010 - 08:49 AM


Is This A Good Question/Topic? 0

Replies To: first program in C

#2 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 2143
  • View blog
  • Posts: 4,208
  • Joined: 30-May 10

Re: first program in C

Posted 22 December 2010 - 08:11 AM

http://www.codeblocks.org/
TurboC is obsolete by 20 years.

It's so obsolete that you have to resort to some rather specialised hacks to even run it on the latest versions of windows.

Think about it, you're using a 16 bit compiler, capable of accessing only 8.3 filenames and 640K of memory.

And your machine is what - 32 or 64 bit, with more memory and file system than poor old TC could ever imagine.
Was This Post Helpful? 2
  • +
  • -

#3 newclearner  Icon User is offline

  • D.I.C Regular

Reputation: 103
  • View blog
  • Posts: 302
  • Joined: 29-September 10

Re: first program in C

Posted 22 December 2010 - 08:11 AM

Get a better compiler than TurboC. Its outdated. Get Code::Blocks or MS Visual Studio.
EDIT - Oops!! Me ans Salem posted at the same time. :P

EDIT EDIT - Here is download link for your convenience
http://www.codeblocks.org/downloads/26

This post has been edited by newclearner: 22 December 2010 - 08:23 AM

Was This Post Helpful? 2
  • +
  • -

#4 p_v_a  Icon User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 22
  • Joined: 13-December 10

Re: first program in C

Posted 22 December 2010 - 08:15 AM

Why are you working in turbo c?
I recommend switching to MS Visual Studio 2010 or Code::Blocks.
If you have an old computer try an older version of MS Visual Studio.

Third right here.

This post has been edited by p_v_a: 22 December 2010 - 08:16 AM

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1