July 2, 2007
<stdio.h how can I compile this header file program in linux?
hi, how to compile #include <stdio.h> header files program in linux terminal.how to compile this program in linux?
- #include <stdio.h>
- while(1)
- void main(void)
- {
- You can use stdio.h in LINUX but conio.h & dos.h are not there.
So first of all remove them.
Then make a simple program to print "hello world".
Compile it using gcc or cc followed by program name.
Then run the file a.out as "./a.out" - #include <conio.h> /* for kbhit */
- int key;
- {
- key=getkey();
- {
- Any *NIX has stdio.h.
On the other hand, no *NIX has either conio.h or (especially!) dos.h
- use #ifdef or #indef statements to include/exlude the DOS headers.
ex:
#ifdef DOS
<dos includes here
#endifThen define DOS on your command line or use one of the CPP predefineds for DOS (I don't remember what they are).
- printf("%d %x\n", key, key);
- Hi, I'm assuming that < stands for <
anyways, dos.h,conio.h are not replicated in linux. stdio.h is there.
so it's not possible to compile this under linux using gcc
- int getkey(void);
- #include <dos.h>
Tags: linux server, linux cook book























