Dev C++ newbie

A

ahs4n

I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?
 
F

Felix Palmen

* ahs4n said:
I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

stdio.h is a standard header -- without knowing "dev c++", I'd expect an
IDE for C / C++ to ship one. Maybe show your code and the exact error
message?

conio.h on the other hand is NOT a standard header and therefore
off-topic here. You probably need some win32-api development package (or
it is just the same error as for stdio.h, see above).

Regards,
Felix
 
O

osmium

ahs4n said:
I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

Modify your program so conio.h is no longer needed. Then post that program,
not a fragment or a copy from human memory but the acual *program* DevC
sees.

conio.h in not and never was standard. IOW, don't use it unless you need
it, Hello World doesn't need it.
 
A

ahs4n

I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

Compiling successfully after removing conio but not running?
 
A

ahs4n

I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

Compiling successfully after removing conio but not running?
 
A

ahs4n

Compiling successfully after removing conio but not running?

Try gently stroking your keyboard.

Or, just /maybe/, show some code.

--
 Felix Palmen       (Zirias)  + [PGP] Felix Palmen <[email protected]>
 web:  http://palmen-it.de/ |            http://palmen-it.de/pub.txt
 my open source projects:     |   Fingerprint: ED9B 62D0 BE39 32F9 2488
 http://palmen-it.de/?pg=pro +                5D0C 8177 9D80 5ECF F683

#include<stdio.h>

int main() {

printf(" Hello World! ");

return 0;

}
 
F

Felix Palmen

* ahs4n said:
#include<stdio.h>

int main() {

printf(" Hello World! ");

return 0;

}

This is a FAQ (but no time to look for the link right now).

Your program probably IS running, it just doesn't flush the output
buffer, so you don't see any output. Append \n (newline) at the end of
the string, a newline automatically flushes.

Regards,
Felix
 
C

Chïna Blüe Öyster Cult

ahs4n said:
#include<stdio.h>

int main() {

printf(" Hello World! ");

return 0;

}

Try adding a new line to the printf

printf(" Hello World!\n");

Some systems might not print until a new line is printed.
 
A

ahs4n

I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

no output after \n
 
S

Seebs

I am writing the Hello World program in dev c++, but after compiling
it shows that header files stdio.h and conio.h are not found? How to
include these header files? Or where am I going wrong?

1. C and C++ are different languages.
2. "conio.h" is a header which was popular on some older compilers years
ago, but which basically stopped making sense past the end of the DOS era.
3. "stdio.h" is a standard header, and if your compiler lacks it, your
compiler is busted.

If you're using a specific C++ compiler, try a support resource for that
specific compiler. If you want advice about finding a compiler for a given
platform, try a newsgroup related to programming on that platform.

-s
 
K

Keith Thompson

ahs4n said:
no output after \n

No output from what?

Show us the program that you compiled. Do not re-type it;
copy-and-paste it into your news software (or include the file, or
whatever it takes). Tell us exactly what happened when you ran it.

Windows systems often run programs in their own output windows,
which close when the program exits. If that's the problem, either
find the option in your IDE to keep the output window open, or run
the executable from a command prompt, or, if absolutely necessary,
add an input operation (such as a call to getchar()) to the end of
the program to keep it from terminating until you press <enter>.

And read <http://www.catb.org/~esr/faqs/smart-questions.html>.
 
A

ahs4n

No output from what?

Show us the program that you compiled.  Do not re-type it;
copy-and-paste it into your news software (or include the file, or
whatever it takes).  Tell us exactly what happened when you ran it.

Windows systems often run programs in their own output windows,
which close when the program exits.  If that's the problem, either
find the option in your IDE to keep the output window open, or run
the executable from a command prompt, or, if absolutely necessary,
add an input operation (such as a call to getchar()) to the end of
the program to keep it from terminating until you press <enter>.

And read <http://www.catb.org/~esr/faqs/smart-questions.html>.

--
Keith Thompson (The_Other_Keith) (e-mail address removed)  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

thanks! ran after adding getchar() function
 
F

Felix Palmen

* Seebs said:
1. C and C++ are different languages.

Just a second of using Google reveals that "Dev C++" is, despite of it's
name, an IDE for both C and C++, using GCC internally.

And on a side note, I was a little surprised myself that the C++
compiler in visual studio can be convinced to behave as a C compiler
when you name your input files *.c, something the IDE (visual studio)
doesn't suggest at all.

So, I'm quite positive the OP is indeed writing C code and using a C
compiler. The obvious problems start somewhere else ... (e.g.
understanding the structure of a thread in usenet)

Regards,
Felix
 
A

arnuld

So, I'm quite positive the OP is indeed writing C code and using a C
compiler. The obvious problems start somewhere else ... (e.g.
understanding the structure of a thread in usenet)

I think Seebs was saying that this sentence:

"I am writing the Hello World program in dev c++"

does not clearly mention what the guy is doing or what he wants to convey
to clc and it clearly mentions that the guy does not know what he is
doing :p and I think thats why Keith sent him to ESR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top