C arrays 🗃️

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 61

  • @BroCodez
    @BroCodez  3 роки тому +74

    #include
    int main()
    {
    // array = a data structure that can store many values of the same data type.
    //double prices[] = {5.0, 10.0, 15.0, 25.0, 20.0};
    double prices[5];
    prices[0] = 5.0;
    prices[1] = 10.0;
    prices[2] = 15.0;
    prices[3] = 25.0;
    prices[4] = 20.0;
    printf("$%.2lf", prices[0]);

    return 0;
    }

  • @lauraborghijs3168
    @lauraborghijs3168 2 роки тому +65

    So nice to view this before my exam! Your video's are always well explained and short enough for my attention span :)

    • @vetebesim
      @vetebesim Рік тому +2

      did you pass the exam

    • @farragoprismproductions3337
      @farragoprismproductions3337 2 місяці тому

      It _will_ get better for you. Seeking success while yearning for failure is literally the most Giga Chad mindset you can have as a learner. In theory, it addresses anxiety by having the individual understand that the thing anxiety obsesses over is exactly what a learner should strive for. Look up some quotes on science and ignorance, and you'll be well on your way to schizo-town, like me.
      *Haha, now you're shizo!* sorry I hope you're not schizophrenic.

  • @monkeygodemperor.9412
    @monkeygodemperor.9412 2 роки тому +303

    suprisingly not an indian man but still pretty good.

  • @accepturfate1615
    @accepturfate1615 10 місяців тому +24

    Got 27/30 on final exam because of you thank you bro!

    • @lsjmartin6220
      @lsjmartin6220 3 місяці тому

      I’m really tryna get like u bro, had to retake my c++ class and hopefully I get a better end result this semester

    • @TechSensei7
      @TechSensei7 3 місяці тому +1

      where did the 3 marks go?

  • @singlemotherRespector
    @singlemotherRespector 3 місяці тому +16

    Finally an account that’s NOT Indian. 🙏🏼

  • @ZackAngelMusic
    @ZackAngelMusic 6 місяців тому +1

    Excellent

  • @linuxrant
    @linuxrant 3 місяці тому +3

    In some book about Python (which also starts indexing with 0) the author wrote, that zero'th position is because machine thinks of a movement of an indicator.
    it is 0, because the indicator did not move, he is in starting (0) position. so when you select an index, in Python or C, you think of a pointer, indicator, or "a needle", that moves (or not).
    A needle is a metaphor, but I think it is close to how it works under the hood.

  • @jishnukantasarkar6629
    @jishnukantasarkar6629 Місяць тому

    much more understandable than my collage lectures
    Thanks for helping me Sir

  • @robinpage9362
    @robinpage9362 3 роки тому +15

    Please make a series on x86 Assembly language. Or include some videos on Assembly in vids for other languages like C, that support in-line Assembly. Technically, x86 Assembly (32 bit) is not the same as x64 Assembly (64 bit), so I don’t know how it would work for you, but it would definitely be appreciated by the community!

  • @linuxrant
    @linuxrant 3 місяці тому +1

    Good lesson, thanks. I'm glad I subscribed.

  • @unruly_ronin
    @unruly_ronin Рік тому +2

    Nicely done mate

  • @princeabdullah2197
    @princeabdullah2197 6 місяців тому +1

    Nyc❤

  • @MikeR-pq8qe
    @MikeR-pq8qe 7 місяців тому +3

    Just learning C atm, can anyone tell me why you would use "double" instead of "float" for a money value which only runs to 2 decimal places like the example here? I know it's more accurate for long numbers but if you're only getting 2 dp values what's the advantage?

    • @Nathan-xv1nd
      @Nathan-xv1nd 5 місяців тому +1

      You are right there isn't an advantage unless you are using a really long number

  • @Sacknase381
    @Sacknase381 7 місяців тому +3

    whats anoying is that an array is a pointer, i would really enjoy if u did a video about that, need to understand pointers better

  • @adityadamanjodi
    @adityadamanjodi 2 роки тому +2

    awesome!!!

  • @ugandaforever8942
    @ugandaforever8942 9 місяців тому +1

    Thank you so much!

  • @yuvrajbains3999
    @yuvrajbains3999 2 роки тому +3

    RNS Shukran

  • @nicolet5051
    @nicolet5051 Рік тому +3

    Which extension do you use for C on VS code?

  • @zahinozlan7720
    @zahinozlan7720 25 днів тому

    thanks broski, supplementing CS50 with this because some concepts really go r/whoosh

  • @WINDOWSXP9013
    @WINDOWSXP9013 6 місяців тому +1

    Thx!

  • @bounader
    @bounader Рік тому +5

    2:11
    bro printed my wallet 💀

  • @Ovoworks
    @Ovoworks 2 роки тому +3

    This video is just simplicity

  • @MainulHossainAnik
    @MainulHossainAnik 4 місяці тому +1

    ❤❤DONE❤❤

  • @perf5656
    @perf5656 Рік тому +1

    Thank you!!!!!!

  • @fountain9886
    @fountain9886 Рік тому +1

    thx man

  • @Robert__p9v9
    @Robert__p9v9 6 місяців тому +1

    Hello, I have some delightful news that will brighten your day!

  • @ryanalnaser914
    @ryanalnaser914 2 роки тому +2

    whatever anything I do or did or anything or after or anytime

  • @PSIwolf39
    @PSIwolf39 Рік тому +6

    Here's some code I made with an array:
    #include
    #include
    #include
    #include
    #include
    int main(){
    double height[2] = {72};
    printf("How tall are you? (in inches)
    ");
    scanf("%lf", &height[1]);
    printf("
    I am %.0lf inches tall, ", height[0]);
    if(height[0] < height[1]){
    printf("I am shorter than you by %.1lf inches.", height[1] - height[0]);
    }
    else if(height[0] > height[1]){
    printf("I am taller than you by %.1lf inches.", height[0] - height[1]);
    }
    else{
    printf("We're the exact same hight!");
    }
    }

  • @mrtraci5450
    @mrtraci5450 3 місяці тому +1

    If only legendary chapo saw this

  • @Yoo-o5v
    @Yoo-o5v Рік тому +2

    whats the extension you are using that pops up descriptive code line in a box?

  • @Sandra__4x0j
    @Sandra__4x0j 6 місяців тому +1

    We are pleased to inform you that your Sales Incentive payment has been confirmed.

  • @William___1a4d
    @William___1a4d 6 місяців тому +1

    Poetic revelation: the essence of refunds

  • @zendobod8247
    @zendobod8247 Рік тому +1

    What happens if he print the array with no value

    • @zraie2455
      @zraie2455 Рік тому

      It would be uninitialised so there would be an error

    • @asherrfacee
      @asherrfacee 11 місяців тому +1

      When you initialize an array, you are grabbing a continuous block of memory on the stack.
      int arr[3];
      In this declaration, arr is set to the address in memory of the start of the block of memory you have grabbed. So arr* is the same thing as arr[0], they both point to the start of the memory block.
      In this case, the size of each block of memory is of size int.
      If you don’t set arr[0] to a value before printing it out, then whatever existed there in memory still lives there, we haven’t overwritten it and it’s not an error to print it out. We refer to it as an ‘indeterminate value’ otherwise known as ‘junk’. So if you print it out as an int, then you’ll just see the int representation of whatever data was at that location of memory.
      The fact that data can persist in memory even after we have stopped referencing it can sometimes be exploited by hackers in an exploit called a ‘Memory Dump Analysis’ where they analyze the memory to find sensitive information that was not properly cleared from memory.

  • @LukaMarinkic
    @LukaMarinkic 6 місяців тому +1

    return BigThanks;

  • @raneeks3210
    @raneeks3210 3 роки тому +4

    Can you make some games in C?

  • @Pixel_plays001
    @Pixel_plays001 9 місяців тому +1

    I thought print is only for python ?

    • @Pengui23
      @Pengui23 9 місяців тому +2

      Printf("Hello World! " ) ;

    • @Pixel_plays001
      @Pixel_plays001 9 місяців тому

      Thanks. Is there any type of print function for c++ apart from cout

  • @Tuleen
    @Tuleen 2 місяці тому

    ily

  • @bimbo-yw6ny
    @bimbo-yw6ny 2 місяці тому

    my gcc does not accept [] without value, error no dimension specified. Which program are using? under linux?