User forums > General (but related to Code::Blocks)
Sugesstion about small changes in standard cpp code.
rickg22:
Actually, that's NOT a bad idea. If we put in the comments how to fix the lines, we might give beginners a crash course on bug fixing.
// My first bug (TM). This yields a "blablah" error because yadda yadda.
// To fix, replace the above line with:
// ...........
On a second thought, I can't imagine the dread WE will experience with "I fixed the hello world bug, but it still doesn't compile :( " complaints. :eek:
No, thanks, nevermind.
takeshimiya:
lol :D
How come a discussion of Hello World two pages long?
Michael:
--- Quote from: Takeshi Miya on December 09, 2005, 09:18:24 am ---lol :D
How come a discussion of Hello World two pages long?
--- End quote ---
Yeah :D. But as big things born from smaller ones....
bszente:
--- Quote from: Takeshi Miya on December 09, 2005, 09:18:24 am ---How come a discussion of Hello World two pages long?
--- End quote ---
This thread is absolutely priceless :lol: Realy... I like it a lot.
I think the main should not contain the blocking statement. Anyway a console application should be run in a console, am I right? So actually Code::Blocks does his job well, when you run the console app from the IDE, Code::Blocks waits for e keystroke, when you run outside of the IDE you should run from a console. As simple as possible.
Concerning the main(), the parameters of the function should be definitely present:
--- Code: ---int main(int argc, char *argv[])
--- End code ---
It's much more comprehensive.
Michael:
--- Quote from: bszente on December 14, 2005, 08:07:03 pm ---Concerning the main(), the parameters of the function should be definitely present:
--- Code: ---int main(int argc, char *argv[])
--- End code ---
It's much more comprehensive.
--- End quote ---
Personally, I prefer
--- Code: ---int main()
--- End code ---
when I do not need specific options, otherwise
--- Code: ---int main(int argc, char *argv[])
--- End code ---
What is important is that the main must return type int.
BS says in his technical FAQ:
--- Quote ---A conforming implementation accepts
int main() { /* ... */ }
and
int main(int argc, char* argv[]) { /* ... */ }
--- End quote ---
Michael
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version