Home > Backend Development > C#.Net Tutorial > Detailed explanation of the four basic data types of C#

Detailed explanation of the four basic data types of C#

黄舟
Release: 2017-03-16 13:15:36
Original
1458 people have browsed it

This article mainly introduces the relevant knowledge of the four basic data types of C#, which has a good reference value. Let’s take a look at it with the editor.

Character type char, stores a character enclosed in '' (single quotes), for example:

char sex='男';//存储性别
Copy after login

StringTypestring, stores a string of characters enclosed in "" (double quotes), for example:

string address="北京市宣武区牛街北口";//存储地址
Copy after login

Integer type int, stores Integers, for example:

int age=23;//存储年龄
Copy after login

Double precisionFloating point type double, store decimals, for example:

double salary=7991.63;//存储工资
Copy after login

The above four are the most commonly used data types.

It should be noted that a certain type of variable can only store this type of data, otherwise, an error may occur.

The above is the detailed content of Detailed explanation of the four basic data types of C#. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template