The static keyword in C

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

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

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

    Excellent content, subscribed 🤝

  • @Embedonix
    @Embedonix 7 лет назад +3

    Good points! just a side note to people who might not know! You need to declare the variable as "extern" in a header file to be able to see it in other sources (or translation units).

  • @joris-rietveld
    @joris-rietveld 6 лет назад +1

    Thanks for creating these videos, you are great at explaining stuff.

  • @emmanuelamoh7181
    @emmanuelamoh7181 5 лет назад +4

    Thanks! This explanation was very helpful!

  • @saturdaysequalsyouth
    @saturdaysequalsyouth 4 года назад +2

    I may have missed it in this video but you can also have static functions in C.

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

    cool thanks for the good explanation!

  • @bobesfanchi
    @bobesfanchi 7 лет назад +2

    Can you please do a video explaining the difference between binary semaphore and mutex?

    • @TheBumi12
      @TheBumi12 7 лет назад

      binary has only two states, mutex is more like a stack that can go to the negative.

  • @JW-YT
    @JW-YT 7 лет назад

    Thanks for the darker text, much easier to read...

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

    Members of classes, both functions and variables that are static have another feature in that they are accessible _without instatiating an object_ of that class. Example:
    class Test
    {
    public:
    int a;
    static int b;
    static void testFunc() {}
    };
    int main()
    {
    Test::b = 2; // Ok
    Test::testFunc(); // Ok
    Test::a = 1; // ERROR
    Test *t = new Test();
    t->a = 4; // Ok
    t->b = 6; // Ok
    t->testFunc(); // Ok
    std::cout

  • @mayue6195
    @mayue6195 7 лет назад +1

    does static just mean a special global variable but not all functions can access it?

  • @therealaverma
    @therealaverma 6 лет назад +1

    what a G
    great video

  • @nikpapan
    @nikpapan 5 лет назад

    So, if a class (object instance) has a static variable, do I need to use mutexes when setting/reading its value?

  • @kolhatkarchinmay
    @kolhatkarchinmay 5 лет назад

    Is "static" has to do something with "entrant" and "reentrant" function???

  • @sharifahmad6876
    @sharifahmad6876 7 лет назад

    what is the difference between global and "local to the module".

    • @EmbeddedSoftware
      @EmbeddedSoftware  7 лет назад +1

      A global is accessible to every function in the application. "Local to the module" means accessible to function [below the declaration] in the same file.

  • @bobesfanchi
    @bobesfanchi 7 лет назад

    Good review. Thanks.

  • @RecycleBin0
    @RecycleBin0 6 лет назад

    Maybe do a vid on the @ operator in C (i.e absolute address)

    • @saturdaysequalsyouth
      @saturdaysequalsyouth 4 года назад

      There is no @ operator in standard C. Some non-standard C extensions support that feature but exactly how it's used might vary from compiler to compiler so you'll have to consult the documentation of whatever compiler you're using.

  • @mingtiantao6928
    @mingtiantao6928 5 лет назад

    very helpful

  • @domaincontroller
    @domaincontroller 4 года назад

    Would you be nice to let me know which tool and other apps you are using to record this video ?

  • @carsonholloway
    @carsonholloway 4 года назад

    Why are there classes? This is C++, not C.

  • @neonik6204
    @neonik6204 6 лет назад

    Is this about java or c programming :(