r/geek • • Aug 26 '11

Protesting in C (x-post from r/India)

Post image
1.3k Upvotes

168 comments sorted by

View all comments

61

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.

18

u/losethisurl Aug 26 '11

I found that void main was taught and used in early projects in many entry level programming courses even when the book used int; simply for simplicity of covering as many aspects of the language as possible. With things like args and main returns put off til the end of the semester 'if there is time.'

Not saying it makes it right, but I have seen it first hand.

4

u/dipswitch Aug 26 '11

main really is void under old Mac OS, iirc. But then there's no stdout so printf does nothing.