Translate

C# Değişkenler (Veri Tipleri)

ARKADAŞLAR  MERHABA ÖNCELİKLE BUGÜN YAZIMIZDA C# DEĞİKENLERİNDEN BAHSEDECEĞİZ.BU KONUYU İYİ KAVRAMANIZ GEREKİYOR.

                                                   
                                                                C# Değişkenler (Veri Tipleri)

Değişken (Veri Tipi) Nedir ?
Değişkenler, girdiğimiz değerleri alan veya programın çalışmasıyla bazı değerlerin atandığı veri tutuculardır. Değişken tanımlama ise girilecek ve ya programın getireceği verinin ne olduğuna bağlı olarak değişken türünün belirlenmesidir. Örneğin girilecek verinin bir tamsayı olması halinde o değişkeni de tamsayı olarak tanımlamak gerekir. Değişik türler için bu işlem farklı farklı tekrarlanmalıdır. 
 Tanımlamada Dikkat Edilecek Durumlar 
  •  Bir değerleri olmalıdır veya mutlak suretle null olarak tanımlanmalıdır.
  •  Tanımlama yaparken büyük-küçük harf ayrımı vardır.
  •  Değişken adları rakamla başlayamaz.
  •  Class, namespace ve kontrol isimleri gibi program tarafından kullanılan isimler verilemez.
  •  Aynı kod bloğu içerisinde aynı isimden birden fazla değişken tanımlanamaz.
  •  Özel karakter içermez örneğin /,*,-,+.
  •  Boşluk kullanılamaz.
  •  Türkçe karakter kullanılmamalıdır. Ş, ğ,ü,ö,ç,ı gibi…
  •  Özel sözcükler (if, else, random,  vb.) kullanılmaz.

Değişken Tanımlama
Değişken tanımlamaları şu şekilde yapılmaktadır.
(Değişken Türü)   ( Değişen Adı)  =  (Değeri)  

Metinsel Türler :
C#'ta hem metinsel hem de sayısal olmayan türler de vardır:
bool
Koşullu yapılarda kullanılır. Bool türünden değerlere true, false gibi ifadeler örnek verilebilir.

object

Bu değişken türüne her türden veri atanabilir.
Var
C# 3.0 da artık tür belirtmeksizin değişken tanımlamamıza olanak sağlayan yenilikler mevcut. Ancak bu değişkenlerin özelliği object değişkenler gibi referans tipli değişkenler değildir. Bunun yerine değeri atanırken tipinin belirkendiği değişkenlerdir.
Datetime
İçinde zaman barındıran değişken tipidir.
Değişken Tanımlamaları ve Örnekler
Değişkenler nasıl tanımlanır ve değişkenlerde örnekler;
Sayısal Değişkenler
int Sayi = 5; Örneğinde olduğu gibi bir değer vererek tanımlama yapabiliyoruz bu şekilde yaptığımızda Sayi değişkeninin değeri 5 olur, ayrıca int Sayi = 5+7; gibi işlemde yapabiliyoruz bu örnekde ise 5+7 işeminin sonucu olan 12 değeri verilecektir.
Metinsel Değişkenler
Sayısal değişkenlerde olduğu gibi string Yazi = “Deneme Yazısı”; şeklinde tanımlama yapabilmekdeyiz, ama Sayısal değişkenlerde olduğunu gibi matematiksel işlemleri yapamıyoruz. Örnek olarak string Yazi = “5”+”7”; yaptığımızda Yazi değişkeninin değeri 12 yerine “57” olur.



HER ZAMAN OLDUĞU GİBİ KISA BİLGİLER VERMEYE ÇALIŞTIM.TEŞEKKÜR EDERİM.
---------------------------------------------------------------------------------------------------------------------------------------------------
HELLO FRIENDS, TODAY IS OUR FIRST ARTICLE IN C# VARIABLES.YOU NEED A GOOD UNDERSTANDING ON THIS TOPIC.


In C# Variables (Data Types)



Variable (Data Type)?

We entered the values or variables assigned some values are placeholders for data that is how the program works. If the variable definition and the data that will be entered or the program variable as it depends on what you will bring to the determination of the type. For example, the data to be entered as an integer If is an integer then the variable you need to define it. This process should be repeated for different species different. 

Circumstances To Be Considered In Defining 

Absolutely a must have or must be defined as null values.
There is no distinction between uppercase and lowercase letters when making cookies.
 Variable names start with a number.
Class names and namespace names that are used by the control program, such as can be given.
You cannot define more than one variable in the same job within the same code block.
Does not include special characters e.g. /,*,-,+.
Space is not available.
Turkish characters should not be used. S, G,U,o,c,I like...
Special keywords (if, else, random, etc.) it is not used.

Variable Definition

Variable definitions made in the following way.

(Variable Type) ( Name Changed) = (Value) 



Textual Genres :

In C#, and both textual and non-numeric types:

bool
Conditional structures are used. The values from the bool type, true, false, examples of such phrases.

object
All data types can be assigned to this variable type.

There

C# 3.0 also now present innovations that allow us to identify a variable without specifying type. However, these variables as a property of the object variables reference-type variables are not. Instead, the value assigned to the variable which determines the type of.

Datetime


The type of the variable in time that is hosting.

Variable definitions and examples

On the variables how the variables are defined and examples;

Numeric Variables

int number = 5; giving this way a value as in the example, we can define when we do, the value of the variable Count is 5, also int number = 5+7; The process as well as we can do in this example 5+7 is 12, which is the result of the process value will be given.

Textual Variables


Numeric variables As String Type = “essay”; you can make shaped cookies, but we can't do that in mathematical operations, such as numeric variables. As an example, string Font = “5”+”7”; when we do, the value of the variable type instead of 12 “57”.







AS ALWAYS, I TRIED TO GIVE BRIEF INFORMATION.THANK YOU.















Yorumlar

Yorum Gönder

Bu blogdaki popüler yayınlar

C# EDİTÖR OLARAK NE KULLANILIR;NASIL KULLANILIR?

C# PROGRAMLAMA DİLİ NEDİR?