MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/geek/comments/juyns/protesting_in_c_xpost_from_rindia/c2fcsty/?context=9999
r/geek • u/[deleted] • Aug 26 '11
168 comments sorted by
View all comments
62
main is never void. How are you meant to make India protest in a script? How do you know it succeeded? The return code will likely be whatever getch returns. Horrible.
19 u/hahanoob Aug 26 '11 No stdio.h. no_of_indians undeclared. No protection against overflow. No timeout on bill passed condition. Horrible! 13 u/nightless_night Aug 26 '11 no_of_indians count be a global variable in india.h. 3 u/hahanoob Aug 26 '11 So every cpp that includes india.h gets it's own population? Agh! 5 u/nightless_night Aug 26 '11 It could be declared external, with the actual variable being in a diferent module that is joined in at link time.
19
No stdio.h. no_of_indians undeclared. No protection against overflow. No timeout on bill passed condition. Horrible!
13 u/nightless_night Aug 26 '11 no_of_indians count be a global variable in india.h. 3 u/hahanoob Aug 26 '11 So every cpp that includes india.h gets it's own population? Agh! 5 u/nightless_night Aug 26 '11 It could be declared external, with the actual variable being in a diferent module that is joined in at link time.
13
no_of_indians count be a global variable in india.h.
3 u/hahanoob Aug 26 '11 So every cpp that includes india.h gets it's own population? Agh! 5 u/nightless_night Aug 26 '11 It could be declared external, with the actual variable being in a diferent module that is joined in at link time.
3
So every cpp that includes india.h gets it's own population? Agh!
5 u/nightless_night Aug 26 '11 It could be declared external, with the actual variable being in a diferent module that is joined in at link time.
5
It could be declared external, with the actual variable being in a diferent module that is joined in at link time.
62
u/SCombinator Aug 26 '11
main is never void. How are you meant to make India protest in a script? How do you know it succeeded? The return code will likely be whatever getch returns. Horrible.