Re: A very **very** basic question
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Thu, 25 Sep 2008 21:01:19 +0000
mdh said:
As I begin to write more little programs without the help of the
exercises, little things pop up that I need to understand more fully.
Thus, below, and although this is not the exact code, the principle of
the question is the same, ( I hope :-) )
#include <stdio.h>
int i = 0;
int main () { return 0; } /* no errors or warnings*/
but
#include <stdio.h>
int i ;
That's a declaration, and it's fine. It's also a tentative definition,
which is also fine.
i=0;
That's an assignment statement, which counts as code. You can't have code
outside a function.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: A very **very** basic question
- From: lovecreatesbeauty@xxxxxxxxx
- Re: A very **very** basic question
- From: August Karlstrom
- Re: A very **very** basic question
- From: mdh
- Re: A very **very** basic question
- References:
- A very **very** basic question
- From: mdh
- A very **very** basic question
- Prev by Date: Re: A very **very** basic question
- Next by Date: [OT] [Re: Free All Purpose C Library
- Previous by thread: Re: A very **very** basic question
- Next by thread: Re: A very **very** basic question
- Index(es):
Relevant Pages
|
Loading