|
|
#1 |
|
question about c++ in xcode
hello folks,
in visual studio i can just use using namespace std; int main() { return 0; } and in xcode i have to use using namespace std; int main(int argc, const char * argv[]) { return 0; } for it to work? how come i cant do the main without any argument in the parenthesis like i did in visual studio? i tried to do it and get compile failed. i did use google to search but i only understand what the argument does, but i still don't understand why xcode requires it where as visual studio doesn't. thanks for any inputs folks |
|
|
|
0
|
|
|
#2 |
|
nevermind
|
|
|
|
0
|
|
|
#3 |
|
What some compilers allow you to get away with is quite shocking!
__________________
2009 2.66Ghz uMBP, iPhone 4S 32GB, 16GB WiFi iPad |
|
|
|
1
|
|
|
#4 |
|
I generally write my C code in gEdit and then compile it by using make in Terminal... I'm pretty sure it'll compile without any arguments in main() just fine.
|
|
|
|
0
|
|
|
#5 |
|
? I never had to use them in Xcode. You *should* use them because its considered proper practice but most programming books omit them for some reason.
__________________
Macbook Air 13inch Ultimate
Hexcore MacPro 3.33ghz - 24 gigs ram - ATI 5870 - Dual 27inch ACD's |
|
|
|
0
|
|
|
#6 |
|
Most of the time when C++ code compiles on Windows and doesn't compile with either gcc or clang, it turns out that the code was illegal in the first place but some windows compiler still accepted it.
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 04:47 PM.






Linear Mode
