|
-
Oct 21st, 2000, 11:23 AM
#1
Thread Starter
Registered User
Hello, i'm having some problems trying to make my first program, i'm getting an errot hsi is what i typed in the DOS PROMPT, C:\Borland\Bcc55\Bin>bcc32 \hello.cpp and i saved my file in teh C: directory, and it says Borland C++ 5.5.1 for win32, \hello.cpp:
Warning W8070 \hello.cpp 5: Function should return a value in function main() and then it says the turbo Incremntal link, Error: unresolved external '_main' referenced from C:\Borland\bcc55\c0x32.obj
and my code was:
Code:
#include <iostream.h>
Main()
{
cout<<"Hello world";
}
i don't understand what i did wrong so if u know, please post it!
Thanks for listening 
Cory
-
Oct 21st, 2000, 12:20 PM
#2
Monday Morning Lunatic
Damn those capital letters...
C++ is case-sensitive, and you also didn't give main a return type. So...
Code:
void main() {
cout << "Hello World";
}
is what you need.
One small point...keep your code well-spaced, because when you write larger programs, C++ gets unreadable very quickly!
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 24th, 2000, 02:52 PM
#3
Member
If your code is exactly as you typed it, it is wrong.
try:
Code:
#include <iostream.h>
int main()
{
cout << "Hello world!";
return 0;
}
You must return some value from the main() function
-
Oct 24th, 2000, 03:59 PM
#4
you were missing the void (or return type) prior to your sub.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|