C# type casting 💱

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 40

  • @BroCodez
    @BroCodez  3 года назад +14

    using System;
    namespace MyFirstProgram
    {
    class Program
    {
    static void Main(string[] args)
    {
    // type casting = Converting a value to a different data type
    // Useful when we accept user input (string)
    // Different data types can do different things
    double a = 3.14;
    int b = Convert.ToInt32(a);
    int c = 123;
    double d = Convert.ToDouble(c);
    int e = 321;
    String f = Convert.ToString(e);
    String g = "$";
    char h = Convert.ToChar(g);
    String i = "true";
    bool j = Convert.ToBoolean(i);
    Console.WriteLine(b.GetType());
    Console.WriteLine(d.GetType());
    Console.WriteLine(f.GetType());
    Console.WriteLine(h.GetType());
    Console.WriteLine(j.GetType());
    Console.ReadKey();
    }
    }
    }

    • @vagifgafar2946
      @vagifgafar2946 2 года назад

      Convert.ToInt32() - is not truncating, but rounding

    • @MTP2nd
      @MTP2nd 10 месяцев назад

      ​@@vagifgafar2946 then use
      Convert.ToInt32(Decimal.Round(value, 0, MidpointRounding.ToZero)); since Visual Studio 2022
      }

  • @Cricketstatusyt
    @Cricketstatusyt 2 года назад +22

    I Learned C# From your channel got a job in Fullstack web developer at Cognizant.
    Thank you Bro😍😍

  • @elliotradley4370
    @elliotradley4370 2 года назад +11

    I have been recommending this channel too so many people in my classes, they all love the content, keep up the great content

  • @NexxtMeme
    @NexxtMeme Год назад +7

    Bro i absolutely love how clear and clean your method of teaching is 🙏

  • @excaliburst0054
    @excaliburst0054 Год назад +3

    One best tutor around here in youtube, i watched your java form video, please can you make wpf c# tutorial as well.

  • @scriptles
    @scriptles 6 месяцев назад +2

    So I am a C++ programmer that still uses a little C. My work gave me an offer to go help out another department. My department sorts mail, and the other department does full stack development. They use C# and I have been dragging my feet for years to learn it. Now that I actually am going to be a step closer to my dream I am taking it serious now to learn c#.

  • @sangitakumari5482
    @sangitakumari5482 2 года назад +1

    Nice video 👍👍😊

  • @v4t0z
    @v4t0z 3 года назад +1

    Nice video

  • @Myotiss22
    @Myotiss22 6 месяцев назад

    Thank you for simplicity

  • @urreallysus
    @urreallysus 2 года назад

    best tutorial channel

  • @maxzzzie
    @maxzzzie 2 года назад

    This dude. Is a legend.

  • @WickedJackThe1
    @WickedJackThe1 Год назад +1

    Is it bad practice using only the keywords, for primitive datatypes, to cast?
    double pi = 3.14;
    int a = (int)pi;

  • @lampywicks
    @lampywicks Год назад +4

    I haven't watched the video yet, but I heard that "Oh yeah", scrolled down and saw the channel avatar and name, immediately hit that subscribe button. It became clear to me at this moment, this is no ordinary channel, this is a man's channel. This is the kind of channel you go to when your masculinity is overpowering you and needs to be released through pure unadulterated logic. I already know that by watching your videos, my brain is going to be forming new connections that function as if they were created through the use of organic steroids formulated from the biological specimens of subjects that would make Arnold Schwarzenegger and Randy Savage weep tears of estrogen and pass winds of talcum powder and floral scented air sanitizer. This might sound a bit like a joke, but that's just how I put my thoughts into words. My mind and body is ready. I'll watch the video now.

  • @codingdisciple3765
    @codingdisciple3765 Год назад

    Preciate the video fam🤗

  • @antefavour1327
    @antefavour1327 2 года назад

    Thank you a lot,I really gained well

  • @sandarubandara4437
    @sandarubandara4437 11 месяцев назад

    Thank you

  • @spartanranger
    @spartanranger 3 года назад

    Thanks for the video Bro

  •  3 года назад

    Thanks!

  • @Garrettwest2025
    @Garrettwest2025 2 года назад +1

    You have any projects for c#?

  • @K4vin60
    @K4vin60 9 месяцев назад

    droppin a comment for that algorithm!

  • @ZeeWolfed
    @ZeeWolfed 2 года назад

    thanks

  • @Onyvox
    @Onyvox 2 года назад

    Bool is Cool

  • @ericsebhig664
    @ericsebhig664 3 года назад

    If the user input consist of numbers and sentences, do you have to convert it into a string ?

  • @budderrar5751
    @budderrar5751 2 года назад

    noice

  • @simik4830
    @simik4830 2 месяца назад

    comment for algorithm!!!

  • @whitedinamo
    @whitedinamo 2 года назад

    lesson check😇

  • @Trashcan-Memes
    @Trashcan-Memes Год назад

    didnt you first use VS code now this like is this a mandela effect

  • @syeid_mot
    @syeid_mot 9 месяцев назад +1

    I like pizza

  • @azhanisyahputra9867
    @azhanisyahputra9867 2 года назад

    bro code

  • @jayleonis1334
    @jayleonis1334 8 месяцев назад

    hahahahaha gString...

  • @sarpcanuzel7750
    @sarpcanuzel7750 2 года назад

    fart