Ana sayfa Genel Swift 4 ile Değişken ve Sabit Tanımlamaları

Swift 4 ile Değişken ve Sabit Tanımlamaları

734
52
PAYLAŞ

Herkese merhaba,

Bu yazımızda Swift dilinde değişken ve sabit tanımlamalarını göreceğiz. Swiftte sabitler(constants) “let” kullanılarak, değişkenler(variables) ise “var” kullanılarak tanımlanır.  Adındanda anlaşılacağı gibi, “let” ile tanımladığımız sabitleri daha sonradan değiştiremezken, var ile tanımladığımız değişkenleri daha sonra güncelleyebiliyoruz.

String türünden değişken ve sabit tanımlayarak örneklendirelim;

Yukarıda da belirtildiği gibi, “name” adlı değişkenimizi başında “var” ile tanımladığımız için daha sonra güncelleyebilirken, “surname” adlı değişkenimizi başında “let” ile tanımladığımız için güncelleyemiyoruz.

Değişken ve sabit oluşturma işlemi, veri tipinden bağımsız olarak (String, Int, Double.. vb) her zaman geçerlidir.

Swift programlama dili ile değişken ve sabit tanımlama işlemleri bu şekilde yapılmaktadır. Bir sonraki konumuzda görüşmek üzere 🙂

PAYLAŞ
Önceki makaleSelection Sort (Seçim Sıralama) Algoritması Nedir ?
Sonraki makaleNasıl Veri Toplanır?
Kadir Has Universitesi Elektrik&Elektronik Bölümünden 2016 yılında mezun oldum, mezuniyet sonrası alan değiştirerek bilgisayar bilimi ve programlama üzerine çalışmalarıma başladım. Amacım kendimi geliştirirken bir yandanda, programlama alanındaki türkçe kaynak azlığını giderebilmek için bloglar yazmak.

52 YORUMLAR

  1. I’m not sure the place you are getting your information, however great topic. I needs to spend a while studying much more or figuring out more. Thanks for excellent info I used to be looking for this info for my mission.

  2. I haven’t checked in here for a while since I thought it was getting boring, but the last few posts are good quality so I guess I’ll add you back to my everyday bloglist. You deserve it my friend 🙂

  3. I do agree with all the ideas you’ve presented in your post. They are really convincing and will definitely work. Still, the posts are very short for newbies. Could you please extend them a little from next time? Thanks for the post.

  4. I have been surfing on-line greater than three hours nowadays, but I never found any interesting article like yours. It is lovely value enough for me. Personally, if all website owners and bloggers made just right content material as you did, the internet will likely be much more useful than ever before.

  5. I would like to thnkx for the efforts you have put in writing this blog. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a good example of it.

  6. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  7. I know this website gives quality dependent articles or reviews and additional
    data, is there any other web site which offers
    these things in quality?

  8. I’m not sure where you’re getting your information, but good topic. I needs to spend some time learning much more or understanding more. Thanks for fantastic information I was looking for this information for my mission.

  9. We stumbled over here from a different website and thought I might check things out. I like what I see so now i’m following you. Look forward to looking over your web page again.

  10. I am really enjoying the theme/design of your website. Do you ever run into any browser compatibility problems? A few of my blog visitors have complained about my site not working correctly in Explorer but looks great in Firefox. Do you have any tips to help fix this problem?

  11. Unquestionably believe that which you stated. Your favorite reason appeared to be on the web the easiest thing to be aware of. I say to you, I definitely get irked while people consider worries that they just do not know about. You managed to hit the nail upon the top and defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

  12. This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

  13. Can I just say what a aid to find someone who actually is aware of what theyre speaking about on the internet. You definitely know how to deliver a difficulty to light and make it important. More folks have to read this and perceive this facet of the story. I cant imagine youre no more common because you positively have the gift.

  14. I simply could not go away your website before suggesting that I actually enjoyed the standard info a person supply to your visitors? Is gonna be back frequently to investigate cross-check new posts

BİR CEVAP BIRAK

Lütfen yorumunuzu giriniz
Buraya isminizi giriniz