Elements of the CC Language

 < Day Day Up > 

Elements of the C/C++ Language

The C programming language has its own syntax a specific form in which all commands and code must be written in order to be understood and processed by the computer system. The syntax you should understand when beginning to program in C includes the following:

  • Comments Comments are statements that document code and describe the program. A comment begins and ends with special characters, such as /* and */, that tell the compiler to ignore all content between those characters.

  • Identifiers You need to know how to properly name values, variables, and subroutines, such as &a, *p, and my_func().

  • Keywords Keywords are words that have special meaning to C and are therefore reserved for commands or parameters. The keywords int, char, and struct, for example, are used to declare variables, arrays, structures, and so on.

  • Constants You need to know how to use constants such as integers, floating-point numbers, characters, and character strings, such as 10, a, and "hello", and you need to know how to define symbolic constants, such as #define NULL 0.

  • Syntax notation You need to know how to use operators in expressions, which are used for calculations, retrieval, or assignment of values, such as for (;;) and line[n++] = a;.

You should also learn more about the software tools you will use for programming and the idiosyncrasies and features of the tools, such as GNU's gcc compiler system. (See the section "Using the GNU C Compiler," later in this chapter, for an overview of gcc.)

     < Day Day Up > 


    Red Hat Fedora 4 Unleashed
    Red Hat Fedora 4 Unleashed
    ISBN: 0672327929
    EAN: 2147483647
    Year: 2006
    Pages: 361

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net