Local vs. Global Variables | C Programming Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 11

  • @mertaliturk650
    @mertaliturk650 หลายเดือนก่อน +1

    I really glad to learn these kind of informations as a embedded software engineer. Thank you!

  • @fbi873
    @fbi873 ปีที่แล้ว +1

    This is cool. Great explanation 🌹

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +2

      Thank you, I’m glad you enjoyed it! :-)

  • @khaipinaulak485
    @khaipinaulak485 ปีที่แล้ว +3

    why do you have the { below the function?
    for example:
    int main()
    {
    }
    where as most people do
    int main(){
    }

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +8

      Great question Khaipi! :-) In programming, deciding where to put the brackets is something that people often call a "religious war". It's a bit like using tabs or spaces to indent your code in that you can make an argument for one or the other. But ultimately, what is most important is being consistent. This article covers things in more detail: jeremybytes.blogspot.com/2013/04/where-do-curly-braces-belong.html. In my experience both styles are popular, I'm not sure one is much more popular than the other. I've always put my opening backet on a new line because I like how it makes it very clear that a "new block" is starting, and it puts some blank space between the code and function prototype for readability. You lose some vertical space this way, but modern computers have larger high resolution monitors that can display many lines of code at once (not as true 30-40 years ago).

    • @khaipinaulak485
      @khaipinaulak485 ปีที่แล้ว +3

      @@PortfolioCourses Thanks man

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +3

      You’re welcome! :-)

  • @abdelhakmezenner2855
    @abdelhakmezenner2855 ปีที่แล้ว

    sir , could you explain what is reference(passing) by adresses in functions.

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว +2

      Yes Abdelhak, I actually have a video on that topic here: th-cam.com/video/RecxQUUEOn4/w-d-xo.html. :-)

  • @ramakrishna4092
    @ramakrishna4092 ปีที่แล้ว +2

    GG