-
Okay, this should be a very simple solution to your problem:
Since you're using C, you can forget about <IOstream.h>. It's for C++, so just leave it for now. The "cout << "Hello World"" is also a C++ command, so we'll forget about that too ( for now ).
Heres a simple program that should run perfectly for you:
Code:
#include <stdio.h> // This is the standard header file for the C language
#include <conio.h> // This header contains the getch() function.
void main() {
printf("Hello World!");
getch(); // This function will wait for you to press a key before ending the program
}
Optionally, you can also add the line "clrscr(); " above "printf". This will clear the console screen for you before printing "Hello World!".
Hope this answers the question. :)
(Okay, I apologize. This post was supposed to be a part of the previous one.. oh well :rolleyes: heh)
And now, to convert that same little program to C++.
The Hello World program in C++ will look like this for you, y2k:
Code:
#include <iostream.h>
#include <conio.h>
void main(){
cout << "Hello World!";
getch();
}
Again, getch() will make the prgram wait until you press any key on the keyboard. And once again, adding clrscr() before the "cout" statement will clear the console screen for you.
Cheers. heh
-
I used Borland C/C++ compiler and IDE for a while, but mine is older then yours, then I did not like it to I got Dev-C++. However, If you are running the IDE that comes with Borland, in order to see your output you have to go into one of the menus at the top and choose output. I dont remember what menu it is, but one of them at the end has the output window so you can see what the output was. Otherwise the output will just flash on your screen and then disapear. So look for output in one of the menus and this should fix your problem I hope.
I tcould be wrong, but I had a very simular problem once, and that is how i fixed it.
-
y2k, u don't need to do alt+f9 and ctrl+f9 separately. Just do f9 for remaking the exe(compiling + linking) and ctrl+f9 for compiling+linking+running.
Good to see that u are not afraid to ask even small questions as i have seen many ppl who wud rather mess things up than asking questions abt small things cuz they r too afraid of letting ppl know abt their limitations.
keep it up and best of luck in ur quest.
if u have anything else to ask, feel free to ask abt it.
ele5125, i don't think there is any such option in Borland (atleast not in my 5.02)