Tutorial C# Basics

DaRealPanDa

Global Moderator
Staff member
Supporting-Team
Global Moderator
Social Media
Mar 12, 2018
580
10,917
1,193
22
Germany
I will show you the Basics from the programming language C# ( C-Sharp )
These are really only the Basics, not advanced Stuff.



What is C-Sharp?
Wikipedia Quote:

C#C Sharp (programming language) - Wikipedia (pronounced C sharp) is a general-purpose, multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.[15] It was developed around 2000 by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed for the Common Language Infrastructure.
But what mean this blablabla?

Here are a few important things just explained:


component-oriented:
This means that you can divide a large project into many, smaller subprojects.

This brings with it the great advantage that several developers can deal with different aspects of the program at the same time.

As an an example: We have a class (we'll come back to classes later) called human, in this class are Aunt Erna and Stefan Hubert, these two people are objects in the human class. Or we have the class Player and there is damage in this class, damage would be an object of this class.

imperative programming language
This simply means that the program executes a series of instructions in the order

As an example we have a program with the following functions:

1. Read a file

2. Count the number of words in this file

3. Write the number of words in another file.

Because C # is an imperative programming language, the program will now execute these 3 statements after the series.

What are variables?

A variable is a storage unit in the computer's memory where values can be written.
But values are not just numbers like 1,2,3, but also strings like "hello world" or self-defined types

As I have already explained in the definition of variables, variables have several different types of types. I list you here the most important, which you will encounter in the field of modding.

Important Types:

keyword:
int = integer

.net-data type:
System.Int32

storage:
32 bit
4 byte

value range:
0x8000 0000 up to 0x7FFFFFFF
-2.147.483.648 up to 2.147.483.647

keyword:
uint = unsigned integer

.net-data type:
System.UInt32

storage:
32 bit
4 byte

value range:
0x0 up to 0xFFFF FFFF
0 up to 4.294.967.295

keyword:
long

.net-data type:
System.Int64

storage:
64 bit
8 byte

value range:
0x8000 0000 0000 0000 up to
0x7FFF FFFF FFFF FFFF
-9.223.372.036.854.775.808 up to
9.223.372.036.854.775.807

keyword:
ulong = unsigned long

.net-data type:
System.UInt64

storage:
64 bit
8 byte

value range:
0x0 up to0xFFFF FFFF FFFF FFFF
0 up to 18.446.744.073.709.551.615

keyword:
double

.net-data type:
System.Double

storage:
64 bit
8 byte

value range:
-1,79769313486232x10308 up to
1,79769313486232x1030

keyword:
float

.net-data type:
System.Single

storage:
32 bit
4 byte

value range:
-3,402823x1038 up to
3,402823x1038

keyword:
bool = boolean

.net-data type:
System.Boolean

storage:
8 bit
1 byte

value range:
true or false
(0xFF or 0x00)

keyword:
string

.net-data type:
System.String

value range:
No or more Unicode characters within double quotation marks (") - or null.

Rare Types:

keyword:
byte

.net-data type:
System.Byte

storage:
8 bit
1 byte

value range:
0x0 up to 0xFF
0 up tp 255

keyword:
char

.net-data type:
System.Char

storage:
16 bit
2 byte

value range:
0x0 up to 0xFFFF
(a Unicode character)
0 up to 65,535

keyword:
decimal

.net-data type:
System.Decimal

storage:
128 bit
16 byte

value range:
(-7,9x1028 up to 7,9x1028)
/ 10x10(0 up to 28)

keyword:
object

.net-data type:
System.Object

keyword:
sbyte

.net-data type:
System.SByte

storage:
8 bit
1 byte

value range:
0x80 up to 0x7F
-128 up to 127

keyword:
short

.net-data type:
System.Int16

storage:
16 bit
2 byte

value range:
0x8000 up to 0x7FFF
-32.768 up to 32.767
keyword:
ushort

.net-data type:
System.UInt16

storage:
16 bit
2 byte

value range:
0x0 up to 0xFFFF
0 up to 65.535

Note:
Rare types does not mean that these types are unimportant, but simply much less used and unimportant to the beginner. Since we are here in the basic knowledge of C #, so we leave them away.



More is comming
 
Last edited:

DaRealPanDa

Global Moderator
Staff member
Supporting-Team
Global Moderator
Social Media
Mar 12, 2018
580
10,917
1,193
22
Germany
Thanks you, i will make more and more here from Time to Time but it takes time, because i must translate a complete german book about c# in english and write this stuff then in a simple way.
 

kioslo

Rooted Member
Aug 22, 2018
5
2
3
110
2
I am trying to create my first mod, I don't know code but I want to try something anyway and this helped me understand what I am looking at a little bit because I opened .net reflector and I was lost, I still am but a little less :P
 

Similar threads


About us

  • Welcome to platinmods.com! We are proud to present you the place which let's dreams come true! Focusing on quality and trust we have spend much time to build a gaming community fitting to your wishes and needs. Actually we offer you the finest MODs and Games of the Android section and we slowly expand to the iOS section as well. But games, Android MODs & iOS MODs are not the only things we can offer you. We have tutorials, tools, a very friendly, active and solid community which will help you with any problem you have =) Your happiness is our goal. We hope you enjoy!
  • Feel free to follow us on facebook as well =)

Forum statistics

Threads
16,613
Messages
315,226
Members
445,045
Latest member
SenoA