🔒 Locked
im almoast depressed
Advertisement
Original Post
i got some advice to get pithon to begin with but i cant get a good version of the installer i keep getting errors when i go to install it also i have a c++ compiler but it wont even compile hello world i keep getting funkey errors also is there any thing wrong with this code?? #include main() { printf("Hello World\n"); } i get multiple errors with this what the heck is going on??
well i got [warning] in function 'int:
'printf'
each in a box down at the bottom for errors
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Matt\Desktop\c projects\hello1.cpp" -o "C:\Documents and Settings\Matt\Desktop\c projects\hello1.exe" -fexceptions -g3 -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Documents and Settings/Matt/Desktop/c projects/hello1.cpp: In function `int
and that in the compiler log
'printf'
each in a box down at the bottom for errors
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Matt\Desktop\c projects\hello1.cpp" -o "C:\Documents and Settings\Matt\Desktop\c projects\hello1.exe" -fexceptions -g3 -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Documents and Settings/Matt/Desktop/c projects/hello1.cpp: In function `int
and that in the compiler log
ok that one worked but it was the hedder?
any good c books or toutorials for beginners? that you know of??
any good c books or toutorials for beginners? that you know of??
Quote:
Original post by atomic_west
well i got [warning] in function 'int:
'printf'
each in a box down at the bottom for errors
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Matt\Desktop\c projects\hello1.cpp" -o "C:\Documents and Settings\Matt\Desktop\c projects\hello1.exe" -fexceptions -g3 -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Documents and Settings/Matt/Desktop/c projects/hello1.cpp: In function `int
and that in the compiler log
That isn't the whole error message. It continues on the next line, or something.
For heaven's sake, stick with Python. If you're running any vaguely recent version of Windows, and this direct link straight from python.org doesn't result in a perfectly straightforward install, then something is seriously odd about your system...
Hi,
Well, there is no return in your function :(
Regards,
Quote:
Original post by Ra
You might be getting a warning for using old C headers in C++...
This should give you 0 warnings:
*** Source Snippet Removed ***
Well, there is no return in your function :(
Regards,
Quote:
Original post by Emmanuel Deloget
Hi,Quote:
Original post by Ra
You might be getting a warning for using old C headers in C++...
This should give you 0 warnings:
*** Source Snippet Removed ***
Well, there is no return in your function :(
Regards,
If you read my above post, you will see why there doesn't need to be a return value...
Quote:
Original post by eleusive Quote:
Original post by Emmanuel Deloget
Well, there is no return in your function :(
Regards,
If you read my above post, you will see why there doesn't need to be a return value...
My bad. Just give me the time to read the standard again. Yes, you are right (of course). < joke > Thus, this is valid but bad programming :) < / joke >
Yours,
Personally, I'd try:
Or, in C++,
#include <stdio.h>void main(){printf("Hello World\n");return 0;}Or, in C++,
#include <iostream.h>int main(){cout<<"Hello World\n";return 0;}
In standard C and C++, main() is required to specify an int return type, it is not implied. In C and C++ there is an implicit return 0 at the end of main(). A fully conforming hello world in C++ is:
#include<iostream>#include<ostream>int main(){ std::cout << "Hello World" << std::endl;}
I think this thread has gone astray of being any help to the OP. I really don't think anyone needs to see another hello world program.
I'm not trying to be an ass, its just that the OP's question was answered already and people are arguing over the proper syntax of return statements, streams, input params etc. Starting to look more like a pissing contest, and if the OP wants to post another question they will need to read through all of this crap.
I'm not trying to be an ass, its just that the OP's question was answered already and people are arguing over the proper syntax of return statements, streams, input params etc. Starting to look more like a pissing contest, and if the OP wants to post another question they will need to read through all of this crap.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement