Timeline for LinkedList of int nodes in C++
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 15, 2016 at 6:42 | comment | added | Nick |
Looks like it is in the standard after all. About void in C some(void) is same as C++ some(). in C some() is same as C++ some(...). If I want good style, I always type arguments.
|
|
| Dec 14, 2016 at 6:23 | comment | added | Loki Astari |
Looks like it is: f(void) meaning no paramters in C++11 or C? but I would recomend using the normal (standard) int main()
|
|
| Dec 14, 2016 at 6:17 | comment | added | Loki Astari |
Is int main(void) valid under the standard?
|
|
| Dec 13, 2016 at 15:37 | comment | added | Nick | You, you are correct. edited. | |
| Dec 13, 2016 at 15:37 | history | edited | Nick | CC BY-SA 3.0 |
added 111 characters in body
|
| Dec 13, 2016 at 15:33 | comment | added | Cody Gray |
No, you really don't. The C++ language standard explicitly allows two declarations of main: one with int and char*[] parameters, and the other with no parameters. If argv is one of the parameters, argv[0] generally contains the name of the program, but this is not even guaranteed! Exactly what the arguments are is implementation-dependent.
|
|
| Dec 13, 2016 at 15:30 | comment | added | Nick | about main(). I know main() works, but is wrong.- you always have at least one parameter argv[0] - the program name | |
| Dec 13, 2016 at 15:25 | history | edited | Nick | CC BY-SA 3.0 |
deleted 7 characters in body
|
| Dec 13, 2016 at 15:13 | history | edited | Nick | CC BY-SA 3.0 |
added 3 characters in body
|
| Dec 13, 2016 at 15:12 | comment | added | Cody Gray | It's perfectly valid to mention that it is non-standard, albeit widely supported. That's good for someone to know. But yes, I'd remove the claim about one or the other being faster. Or link to the original source of the claim. | |
| Dec 13, 2016 at 15:11 | comment | added | Nick | no idea, saw this on stackoverflow . I never use pragma once. do you think I should remove this? | |
| Dec 13, 2016 at 15:09 | comment | added | Cody Gray |
"Some people reports it is even faster than #pragma once." [citation-needed] Who says this? If anything, #pragma once will be faster in parsers that special-case it. But nowadays, every toolchain worth its salt recognizes and optimizes both idioms. Also, it's perfectly valid for the entry point to have the signature int main() if you don't need the arguments.
|
|
| Dec 13, 2016 at 14:59 | history | answered | Nick | CC BY-SA 3.0 |