Concept

What are the basic syntax rules of C?

ComputerScienceOne / Basic Syntax Rules

"C is a highly influential programming language. Many modern programming languages have adopted syntactic elements that originated in C. Usually such languages are referred to as “C-style syntax” languages. These elements include the following. • C is a statically typed language so variables must be declared along with their types before using them. • Strings are delimited with double quotes. Single characters, including special escaped characters are delimited by single quotes; \"this is a string\" , and these are characters: 'A' , '4' , '$' and '\n\n' • Executable statements are terminated by a semicolon, ; • Code blocks are defined by using opening and closing curly brackets, { ... } . Moreover, code blocks can be nested : code blocks can be defined within other code blocks. • Variables are scoped to the code block in which they are declared and are only valid within that code block. • In general, whitespace between coding elements is ignored. Though not a syntactic requirement, the proper use of whitespace is important for good, readable code. Code inside code blocks is indented at the same indentation level. Nested code blocks are indented further. Think of a typical table of contents or the outline of a formal paper or essay. Sections and subsections or points and subpoints all follow proper indentation with elements at the same level at the same indentation. This convention is used to organize code and make it more readable."

Related Ideas

What are the basic syntax rules of C? | ComputerScienceOne | Bifalgorithm | Bifalgorithm