What is data type in c#?

0 votes
54 views
Pradeep kumar Patel asked 23-Oct-2019 in Programming Language by Pradeep kumar Patel
edited 23-Oct-2019 by Pradeep kumar-Patel

What is data type in c#?

1 Answer

0 votes
Pradeep kumar Patel answered 25-Oct-2019 by Pradeep kumar Patel
A data type specify type of data the variable can store such as character, integer, string, float etc. C# is a strongly typed programming language. It is essential to inform the compiler what kind of data these memory location will hold. In this page you will learn about the different data types that are supported in c#.
 There are three types’ data in c#.
1. Value data type.
2. Reference data type.
3. Pointer data type.
Value Data Type : The value data type are integer –based on floating-point based. C# language supports both signed and unsigned literals.
There are two types of value data type in c#.
1) Predefined Data Types –such as Integer,Float ,Boolean,Decimal,etc.
2) User defined Data Types –such as Structure,Enumrations,etc.
Reference Data Type : The reference data types do not contain the actual data stored in a variable, but they contain a reference to the variables.
If the data is changed by one of the variables, the other variable automatically reflects this change in value.
There are two types of reference data type in c #.
1) Predefined Data types-such as Objects, String.
2) User defined Data types-such as classes, interface.
Pointer Data Type
The pointer in c# is a variable, it is also known as locator or indicator that points to an address of a value.
Symbol Name Description
& (ampersand sign) Address operator Determine the address of a variable.
* (asterisk sign) Indirection operator Access the value of an address.
Declaring a pointer
The pointer in c# can be declared using * (asterisk symbol)
Int * a;       // pointer to int

Char * c; // pointer to char