C arrays 🗃️

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024
  • C arrays tutorial example explained
    #C #arrays #tutorial
    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;
    }

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

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

    #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;
    }

  • @monkeygodemperor.9412
    @monkeygodemperor.9412 ปีที่แล้ว +189

    suprisingly not an indian man but still pretty good.

    • @Ishaan-ok6uw
      @Ishaan-ok6uw ปีที่แล้ว +5

      Hahaha totally agree with u 😆

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

      😂😂😂i was looking for this

    • @HiroshimabomBBBOOOM
      @HiroshimabomBBBOOOM 9 หลายเดือนก่อน

      💀💀😂

    • @ftmelbialy
      @ftmelbialy 8 หลายเดือนก่อน

      YESSSS

    • @whatatime4342
      @whatatime4342 5 หลายเดือนก่อน

      😂😂😂

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

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

    • @vetebesim
      @vetebesim 9 หลายเดือนก่อน +2

      did you pass the exam

  • @ZackAngelMusic
    @ZackAngelMusic 26 วันที่ผ่านมา

    Excellent

  • @accepturfate1615
    @accepturfate1615 5 หลายเดือนก่อน +5

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

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

    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!

  • @princeabdullah2197
    @princeabdullah2197 24 วันที่ผ่านมา

    Nyc❤

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

    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

  • @MikeR-pq8qe
    @MikeR-pq8qe หลายเดือนก่อน +1

    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 13 วันที่ผ่านมา +1

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

  • @WINDOWSXP9013
    @WINDOWSXP9013 หลายเดือนก่อน

    Thx!

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

    Nicely done mate

  • @ugandaforever8942
    @ugandaforever8942 4 หลายเดือนก่อน

    Thank you so much!

  • @Robert__p9v9
    @Robert__p9v9 หลายเดือนก่อน

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

  • @bounader
    @bounader 9 หลายเดือนก่อน +2

    2:11
    bro printed my wallet 💀

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

    awesome!!!

  • @PSIwolf39
    @PSIwolf39 8 หลายเดือนก่อน +3

    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!");
    }
    }

  • @nicolet5051
    @nicolet5051 7 หลายเดือนก่อน +2

    Which extension do you use for C on VS code?

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

    RNS Shukran

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

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

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

    This video is just simplicity

  • @William___1a4d
    @William___1a4d หลายเดือนก่อน

    Poetic revelation: the essence of refunds

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

    Thank you!!!!!!

  • @Sandra__4x0j
    @Sandra__4x0j หลายเดือนก่อน

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

  • @LukaMarinkic
    @LukaMarinkic หลายเดือนก่อน

    return BigThanks;

  • @user-ql1uk3ty1v
    @user-ql1uk3ty1v 10 หลายเดือนก่อน +1

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

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

    thx man

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

    Can you make some games in C?

  • @zendobod8247
    @zendobod8247 8 หลายเดือนก่อน

    What happens if he print the array with no value

    • @zraie2455
      @zraie2455 8 หลายเดือนก่อน

      It would be uninitialised so there would be an error

    • @asherrfacee
      @asherrfacee 5 หลายเดือนก่อน +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.

  • @Pixel_plays001
    @Pixel_plays001 4 หลายเดือนก่อน

    I thought print is only for python ?

    • @Pengui23
      @Pengui23 4 หลายเดือนก่อน +2

      Printf("Hello World! " ) ;

    • @Pixel_plays001
      @Pixel_plays001 4 หลายเดือนก่อน

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