24.12.2012 Views

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Variable names:<br />

Variable Declarations<br />

– A valid variable name starts with a letter or underscore ( ), <strong>and</strong> may contain<br />

any sequence <strong>of</strong> letters, underscores, <strong>and</strong> digits<br />

– Capitalization is significant – a variable is different from A Variable<br />

– In addition to the language keywords, certain other names are reserved (by the<br />

st<strong>and</strong>ard library or by the implementation). In particular, avoid using names<br />

that start with an underscore!<br />

Variable declarations:<br />

– A (simple) variable declaration has the form ;, where<br />

is a type identifier (e.g. int), <strong>and</strong> is a coma-separated list<br />

<strong>of</strong> variable names<br />

– In ANSI-89 C, variables can only be declared outside any blocks or directly<br />

after an open curly brace. The new st<strong>and</strong>ard relaxes this requirement<br />

– A variable declared in a block is (normally) visible just inside that block<br />

Stephan Schulz 96

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!