Re: C coding guidelines



Nick Keighley wrote:
On 26 Aug, 13:12, Walter Banks <wal...@xxxxxxxxxxxxx> wrote:
arnuld wrote:
In Indian Education system, in Punjab School Education Board (where I
did my graduation) or Kurukshetra University from where my friend did
his Masters or in around 10 Engg. colleges from where my other friends
(old classmates) did their Bachelors of Technology and Bachelors of
Engineering, at *all* of those places me and they were taught to write
void main(). It was CLC who taught me, very first time in my life, to
use int main(void).
If you are writing code for embedded systems main will never return and it is appropriate to write void main (void). The C standard says that main will return an int.

not necessarily. There may be no main at all in that case!

Or the implementation might document that main returns an int (I believe the TMS320C25 documentation used to, in fact it used to include a copy of K&R2, which was the first copy of it I obtained!
--
Flash Gordon
.



Relevant Pages

  • Newbie : friend function problem
    ... The problem relates to a Class Time and within it I have defined a friend ... When I program the function inline within the class definition everthing ... int minutes; ... void AddMin; ...
    (comp.lang.cpp)
  • Newbie : Problem with a friend function
    ... The problem relates to a Class Time and within it I have defined a friend ... When I program the function inline within the class definition everthing ... int minutes; ... void AddMin; ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Please Comment on this Integer to String Code.
    ... representation from base -32 to 32(32 since strtoul takes 32). ... One friend points out that it takes upto 36. ... void printBase ... int main ...
    (comp.lang.c)
  • Re: C coding guidelines
    ... did my graduation) or Kurukshetra University from where my friend did ... at *all* of those places me and they were taught to write ... If you are writing code for embedded systems main will never return and it is appropriate to write void main. ... The C standard says that main will return an int. ...
    (comp.lang.c)
  • Re: a yacc problem, help!
    ... int yywrap ... void yyerror; ... I want to know why it could run at the first time, ...
    (comp.lang.c)