C # language and variables, data types

Source: Internet
Author: User

First, computer language

1. Computer language includes: c\php\ruby\java\c#\basi\js\c++

2. History of computer language: Machine language--assembly language--high-level languages

Second, the Code

1, Program always: Code (code), Compile (Compile), run (running)

2. Intermediate Code Conversion software Net

3, the output mode of the code: 1, Console.Write ("text content");--output text at the cursor position

2, Console.WriteLine ("Text content");--output text at the cursor position, then wrap.

Third, the data

1, C # Common data type 1, char single text plus ' single quotation mark

2, String Unlimited number of words (can be 0) plus "" "double quotation marks

3, int integer Direct write

4, double decimal direct writing

2. Variables

1, definition: Represents a piece of memory space to store data

2, declaration--Data type + space + variable +;

3, assignment-variable name = data;

3, variable name hard requirements

1, the variable name can only be composed of numbers, letters, underscores.

2. Variable names must not begin with a number.

3. The variable name must not be the same as the keyword.

4. Variable names in the same function must not be the same.

4. Soft Requirements for variable names

1, words too literally

2. First Letter Lowercase

3, except the first word Weishou letter to capitalize

5, the use of variable skills

1, Merge declaration--different variable names are directly separated by commas.

2, declaration initialization--the variable is initialized while declaring a variable.

3. Variable three elements--type, name, value

6. Data operation

+ (plus)-(minus) * (multiply)/(except)% (remainder) The return type is the same as the operation type

7. String arithmetic

+ (stitching) return type: String (String type)

8. Input statement consle.readline ();--Get user input in console

9, type conversion: one type of data, through conversion, to get another data.

C # language and variables, data types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.