General structure of the program in C #, Identifiers...

Common program structure in C # language

The general structure of the application can be described as follows:

1. The program consists of descriptions of user-defined types (mostly classes).

2. Descriptions of classes consist of the description of fields (variables) and methods.

3. The description of variables consists of specifying the type and name of the variable.

4. The description of methods consists of a description of local variables and a set of statements.

5. The operator consists of a set of keywords and expressions.

6. Expressions consist of variables and constants associated with operation signs.

First of all, let's make some general explanations of the C # syntax. In this language, as in other languages ​​based on the C language, most statements end with the semicolon (;). Multiple statements can be written in one line, or one statement can be written in several lines. Operators can be combined into blocks using curly braces ({}).

Comments can be inserted into the program text (the compiler processes them ns). A comment on one line begins with two consecutive symbols slash (//), and the comment, located on several lines, begins with the symbols /* and ends with the characters */.

For all C # language elements, such as variables, fields, methods, classes, and so on, you specify the identifiers.

Identifiers in C #

The identifier can consist of characters (Latin letters and United States alphabets, large and small), digits and underscore, but can only start with a letter or underscore. The C # language is case sensitive and the compiler distinguishes between small and large letters. This concerns the writing and identifiers of the program and the keywords of the language. This means that the Aaaa and aaaa identifiers are different, just like class and Class.

The full name of the user-defined type consists of the identifier of the namespace to which it belongs and the very identifier (name) of the user-defined type that are combined with a period character, for example: Nnnn.Aaaa (user-defined type Aaaa in the Nnnn namespace) or ConsoleApp.Program ( class Program from the ConsoleApp application.)

All identifiers must be unique in their scope:

• The scope of the custom types is the namespace in which it is described.

• The scope of the elements of the class is the class in which they are described.

• The scope of the local variables of the method is the block of operators of the method or the method as a whole.

Application Types

In C #, you can develop applications with a console interface (console applications) and a graphical interface (Windows-based applications). The type of application being created is specified when the compiler is started. Initially, the tutorial focuses on console applications, since they require less code and are easier to create. Chapter 8 will discuss creating Windows applications that require knowledge of working with classes in C # and use a large number of classes in the FCL library.

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)