Timeline for Addition of two number using array of unequal size
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 9, 2017 at 17:00 | comment | added | Edward | @TobySpeight Yes, good point. | |
Aug 9, 2017 at 16:23 | comment | added | Toby Speight |
The cast of malloc() is generally considered a Bad Thing, as is the need to keep the argument to sizeof consistent - num3 = malloc((sizeof *num3) * (num1_n + 1)) is safer and clearer (the parens around the sizeof expression are just there for clarity).
|
|
May 23, 2017 at 12:41 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Dec 22, 2016 at 22:21 | comment | added | Edward | @chux Agreed on all counts. | |
Dec 22, 2016 at 22:20 | comment | added | chux |
To return 0; or not return 0; , that is the question. unfortunate;y gets too much comment time, including this comment. The best answer is for OP to code "Addition of two number using array of unequal size" as a stand-alone function, with test code driven (in)directly from main() . No need to even review main() in that case.
|
|
Dec 22, 2016 at 21:53 | history | answered | Edward | CC BY-SA 3.0 |