Buckys C++ Programming Tutorials - 35 - Passing Arrays to Functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024
  • Source Code: github.com/the...
    Core Deployment Guide (AWS): docs.google.co...

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

  • @shalinisahnimankatalia5305
    @shalinisahnimankatalia5305 5 ปีที่แล้ว +220

    He says loads of times that "How am i going to explain this " and ends up explaining it the best in the world.

    • @entertainingshorts24
      @entertainingshorts24 3 ปีที่แล้ว

      'Best in the world'...really??
      I think u haven't checked other programmers cum teachers on TH-cam.
      He is good, but 'best' signifies Hyperbole ( Atishyokti alankar).

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

      @@entertainingshorts24 But he is literally one of the best if you want the explanation to be short, sweet and entertaining as well. I literally watched 30+ videos of his in a single day and still not bored while if I try to watch some other youtuber explaining it I would probably sleep through 1st tutorial itself.

    • @entertainingshorts24
      @entertainingshorts24 3 ปีที่แล้ว

      @@omkarjsuvarna may be...but if u are a hindi speaker then u can also follow Codewithharry.

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

      @@entertainingshorts24 Again as I said I want short and sweet explanation to grasp the topic really quickly and once I understood it then I can dive deep to complex programs. For learning basics fast this channel is like a diamond. I've watched tutorials of Codewithharry, but I always stop watching the video after 1 or 2 tutorials. But in this channel, I've never stopped watching it continuously.

    • @svenspajgl9118
      @svenspajgl9118 2 ปีที่แล้ว

      @@entertainingshorts24 shush kid

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

    Crazy how this tutorial is still as informative 13 years later. Preciate the good work 👏

  • @aditijoshi4240
    @aditijoshi4240 6 ปีที่แล้ว +193

    Prof: gimme some name for the array
    Me: bucky

    • @lastofthestars6481
      @lastofthestars6481 6 ปีที่แล้ว +5

      prof: gimme some name of the array you boy
      me: Aditi joshi
      class: hahahahahhhaa
      prof: get the fuck outta here

    • @sameeralam8829
      @sameeralam8829 5 ปีที่แล้ว +5

      @Shallex little virgin let him laugh

    • @cabreram.4734
      @cabreram.4734 5 ปีที่แล้ว +2

      Sheez 🤦🏻‍♂️ these virgins are so cringy

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

      For real for real

  • @martyyoung
    @martyyoung 10 ปีที่แล้ว +14

    I have watched 20 or so and some a couple of times just to get it through my head. Great stuff!!!!!

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

    8 mins of Bucky's tutorials VS 2 whole lectures

  • @ADwaMoviesandMusicsproduction
    @ADwaMoviesandMusicsproduction 4 ปีที่แล้ว +4

    Thank you a million times, I watched like 100 videos for this. I even watched your videos like 10 times but didn't understand because I already belived that it's so hard. And now understand everything from 6:30 to 7:30? Thanks a lot, my home work and project was due to 3 days later. didn't know it's easy.

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

    You know, I've been messing around with arrays and I discovered that you can create an even cooler RNG program using arrays.
    All you have to do is create a for loop where the value of each element in the array is assigned to a seeded random number.
    Here's an example:
    #include
    #include
    #include using namespace std;void romba(int Input[], int Size);int main()
    {
    cout > y; int fofo[y];
    srand(time(0)); for(int x = 0; x < y; x++){ fofo[x]= rand()%y;
    } romba(fofo, y); return 0;
    }void romba(int Array[], int Size){for(int x = 0; x < Size; x++){ cout

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

    literally saving my semester 😭👌🏼

    • @dark-_-001-kys
      @dark-_-001-kys 3 ปีที่แล้ว

      which semester brother i mean in which semester it was asked

  • @Faith-sf2fi
    @Faith-sf2fi 4 ปีที่แล้ว

    These quick videos teach me so much better & faster than my professor and the “teaching” program he makes me buy which mind you is expensive !

  • @10YardCricket
    @10YardCricket 7 ปีที่แล้ว +11

    He explains everything so much that during 5: 03 he was out of explanations .. Legend

  • @fatima-oy7gk
    @fatima-oy7gk 3 ปีที่แล้ว

    Wow. I was super stressed. I couldn't understand no matter how many tutorials I watched. Now I do Alhamdolilah. Thank you so much.

  • @ucheezih1416
    @ucheezih1416 11 ปีที่แล้ว

    This guy really knows what he's teaching...Two topics in C++ that I found difficult to understand(Multidimensional array and this right here- passing arrays into Functions), he really demystified it all...Even in an easy to understand manner...10x bro...

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

    Bucky, one of the best teacher for programming !

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

    Actually, the reason you don't pass bucky with square brackets is because it is a pointer to the first element of the array.
    You cannot pass the whole block of an array as an argument (mainly because it's very slow to copy the entire array), so you just pass the address of the first element.

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

    We went from 360p to 4K in 7 years! Amazing!

  • @rubbeldiekatz85
    @rubbeldiekatz85 12 ปีที่แล้ว

    thanks man. I wracked my brain about how to put an array into a function. Now my programm is running. I appreciate your help.

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

    This video helped me a bunch on my homework. Thank you!

  • @odo432
    @odo432 11 ปีที่แล้ว

    For someone who's never said WOW in their life you certainly said it a lot in your post.

  • @mituldesai9807
    @mituldesai9807 8 ปีที่แล้ว

    Excellent class..had no problems understanding whatsoever..u r a lifesaver!!

  • @Qazqi
    @Qazqi 11 ปีที่แล้ว

    I'm not quite sure what you're asking, but that statement is fine, provided the variables all have a value.

  • @KydroxHD
    @KydroxHD 7 ปีที่แล้ว +7

    i listen to this in 1.5 speed, its actually pretty efficient

  • @stephanschultz7560
    @stephanschultz7560 5 ปีที่แล้ว +18

    if you put the main function under the void function, you won't get an error message and will work just fine.

  • @EPKX
    @EPKX 11 ปีที่แล้ว

    yes you have to tell the computer that the elements in the array are integers, it makes sence too since array is nothing but a variable that can have different values at different time depending on the input, we treat x[ ]
    the same way we treat x

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

    Little tip for you guys: you can get the length of an array by using this:
    int length = sizeof(array) / sizeof(/*arraytype eg.:*/ integer)

  • @ivanbeltran-salazar117
    @ivanbeltran-salazar117 8 ปีที่แล้ว +2

    Great tutorial cleared up the basics

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

    as an options, you can use a vector for this sort of thing, so you won't need to use second variable "sizeofarray".
    but probably it is more advanced lvl.

  • @gijimbo1337
    @gijimbo1337 9 ปีที่แล้ว

    FYI (not sure if anyone else has mentioned this yet) if you don't want to worry about the array sizes or don't know the array sizes, look into using vectors.

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

    I love how you teach.

  • @Shawn_White
    @Shawn_White 6 ปีที่แล้ว

    I'm using G++ as a compiler and it works even without the prototype.

  • @knuhuf2
    @knuhuf2 8 ปีที่แล้ว

    use sizeof(nameOfArray) to determine the size of an array. This gives you the size in bytes so just divide it by the size of each element in your array, e.g int, float, long = 4 and double = 8.
    I'll throw in an example:
    int myArraySize = sizeof(myArray)/4;

  • @123455866201Aaron
    @123455866201Aaron 5 ปีที่แล้ว

    TH-camr guides > Your uni lecturer

  • @azstudioproductions
    @azstudioproductions 12 ปีที่แล้ว

    You have been helping me so much ! Thank you so much !

  • @onurkirec5784
    @onurkirec5784 11 ปีที่แล้ว

    I wish there were some manner tutorials for guys like you.

  • @iXenoCider
    @iXenoCider 12 ปีที่แล้ว

    Its the name of a book, "C++ for Dummies", they have a TON of books like "C# for dummies", "Karate for Dummies", FILLINWORDHERE "For Dummies".

  • @lmao3295
    @lmao3295 8 ปีที่แล้ว

    this really confused me for a bit but thanks to you i get it now c:

  • @Classic112
    @Classic112 10 ปีที่แล้ว

    the best way to explain why you don't need to label it as an array is because in your prototype you are calling for an array so it will automatically look for an one.

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

    great work sir !!
    hats off to you

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

    It annoys me that he keeps asking "What is going on guys?" but doesn't give us time to answer.

    • @QrUpload
      @QrUpload 7 ปีที่แล้ว

      hahhaa nice one bro !

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

      hhhhhhhhhhhhhhhhhhhhh same thing XD

    • @nickbossbg5636
      @nickbossbg5636 7 ปีที่แล้ว

      xDDDDDDDDDDDDD

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

      when you realize you have no social life

    • @hananeikh
      @hananeikh 6 ปีที่แล้ว +5

      u can just pause and answer it to urself

  • @syedsamiullah6573
    @syedsamiullah6573 3 ปีที่แล้ว

    Video almost a decade ago helped me today..😘😘

  • @puvistyne28
    @puvistyne28 8 ปีที่แล้ว

    Thank you very much...exactly what i expected

  • @Chriscs7
    @Chriscs7 13 ปีที่แล้ว

    NICE TUTORIALS BUCKY! BUT INSTEAD OF PROTOTYPING FUNCTIONS YOU CAN JUST WRITE THEM BEFORE THE MAIN FUNCTION SO YOU DONT NEED TO COPY THE HEADER,IT WORKS FINE THAT WAY TOO.

  • @arbazkhalid8249
    @arbazkhalid8249 6 ปีที่แล้ว

    great : i a'm confused how to use array but now i'm happay after your tutorial.

  • @alexandersamudra6822
    @alexandersamudra6822 2 ปีที่แล้ว

    one of the best explain 👍

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

    Thanks for making these. :)

  • @kjw21411
    @kjw21411 9 ปีที่แล้ว

    I'm trying to make a card game and shuffle the cards, then deal them (3 cards will be dealt per play), but I keep getting multiple duplicate values for the shuffled and dealt cards. The values in the array are 0 - 51, each of which represent one of the 52 cards. Here are the two functions. top is the top card in the deck array and numCards keeps track of how many cards have been dealt.
    void shuffle(int numCards, int deck[ ]) {
    for (int top = 0; top < 52; top++)
    {
    int r = rand() % 52;
    int temp = deck[top];
    deck[top] = deck[r];
    deck[r] = temp;
    cout

  • @YounesKeraressi
    @YounesKeraressi 13 ปีที่แล้ว

    bucky,you still the best

  • @tokhirbekorifjonov2200
    @tokhirbekorifjonov2200 3 ปีที่แล้ว

    very good and clear explanation thank you very much

  • @karthikeyanb6016
    @karthikeyanb6016 6 ปีที่แล้ว

    amazing bro....... thank u soo much.... u have made this very easy to understand...... ty bro

  • @Boomerlance
    @Boomerlance 12 ปีที่แล้ว

    Got it!
    thanks again,dude :)

  • @hrbharry
    @hrbharry 11 ปีที่แล้ว

    Normally you don't want to copy the entire array, you use a pointer. And the array should be allocated on the heap anyways

  • @jblackwell1014
    @jblackwell1014 11 ปีที่แล้ว +4

    ahhh Jessica... the one that got away

  • @OceanageMangoma-w4p
    @OceanageMangoma-w4p 10 หลายเดือนก่อน

    woww thanks you really helped me a lot, l got a final tomorrow 🔥🔥🔥🔥

  • @iXenoCider
    @iXenoCider 12 ปีที่แล้ว

    Yes lol, I know, I gave you the link to this video! :D, glad it helped! Goodluck on your coding!

  • @colouredmirrorball
    @colouredmirrorball 13 ปีที่แล้ว

    Apparently there is no function to return the length of an array in C++. If you want to use the length of an array, you need to use sizeof(*name of your array*) / sizeof(*name of your array*[0]). Sizeof() returns the number of bits a variable has, so if you had an array consisting of integers, and your array had 20 elements, the size of your array would be 80 as the size of an integer is 4.

  • @winnermsigwa4922
    @winnermsigwa4922 2 ปีที่แล้ว

    Thanks ..and be blessed🙏

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

    I have one question. When I define the function printArray before main function, I don't really need to prototype printArray (i.e. Declaration). The program run fine and I got no error or warning messages. How does that even work? Thx!

    • @tanyichun2535
      @tanyichun2535 4 ปีที่แล้ว

      computer programs read the code from top to bottom, the reason why you need to prototype a function is because the function is defined after the main function, so the computer would have no idea what the function is since it hasn't read the function yet, that's why you need to prototype the function to let it know beforehand that this function will be defined later after the main function. if you define the function before the main function then there's no need to prototype it because the function has already been read before the main function.

  • @ceciliaamoako9694
    @ceciliaamoako9694 5 ปีที่แล้ว

    You are a lifesaver

  • @td4269
    @td4269 8 ปีที่แล้ว

    This is so useful. Thank you

  • @NBA2KLTT17
    @NBA2KLTT17 6 ปีที่แล้ว

    Besides LeBron, you are the GOAT.

  • @4ThaCulture
    @4ThaCulture 11 ปีที่แล้ว

    No, an array has all of the same type of data. Hence, here the datatype is integer. If you wanted to do the alphabet you would probably use char array[] etc, but it can't mix numbers and characters. Hope this helps@Zakareya Alatoli

  • @user-cf7vy4hl8p
    @user-cf7vy4hl8p 10 ปีที่แล้ว

    You aren't wrong when you state that "the reason why an array when called within main isn't using square brackets, is because the name of the array is "Jessica", That was just a little vague,More over it is because the function has taken the parameter of an array first. ex: "void blahblah(int whatever[ ], int sizeofarr)" so when called it will expect the first parameter you type to be the array. If you had passed the size and then the array ex:"(size, arr)"the program most likely not know what you are referring too.
    Correct me if i am wrong, if this helped Then You're Welcome.

  • @omarimtiaz8211
    @omarimtiaz8211 8 ปีที่แล้ว

    thanks bukky ur tutorials are helpful

  • @Qazqi
    @Qazqi 11 ปีที่แล้ว

    C++ arrays don't have a Length property (or properties in the C# sense at all). For known sizes, it's best to use std::array, and for dynamic arrays, it's best to use another standard container, std::vector being a good one for general use.

  • @onelerv1
    @onelerv1 13 ปีที่แล้ว

    @Chriscs7 Its better programming practice to write a prototype away from the body of the function, you'll see later on, it makes the code easier to read as well as makes the function more encapsulated which is very important as a programmer.

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

    His folder name is Watermelon........hahahahah

    • @TheWarfare07
      @TheWarfare07 7 ปีที่แล้ว +4

      my folder name is tits......hahahaha

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

      FUCK

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

    :O
    *Jaw Dropped*

  • @jakubircow6875
    @jakubircow6875 9 ปีที่แล้ว

    when calling the function, do you put the position of a value in the array in the square brackets when you want to pass the position instead of the whole array ?.

  • @subs2meplease
    @subs2meplease 13 ปีที่แล้ว

    Try printing an array through the function with more indices than it has. You won't get a compiler error ;)

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

    good. One should also pass the size of array as argument in 1D array. How the function will know the size of the 2D array?

  • @InstAmateur
    @InstAmateur 11 ปีที่แล้ว

    The holy oPryze has learned from Master Bucky!

  • @beetlesss2560
    @beetlesss2560 4 ปีที่แล้ว

    Fuck this... I'm in civil engineering and we have this... Harder than calculus!

  • @danbreland3444
    @danbreland3444 7 ปีที่แล้ว

    Jessica 6 is the name of the main female character in the Logan's Run movie.

  • @jirivesely5697
    @jirivesely5697 3 ปีที่แล้ว

    Why parameters in the void function are separated by a comma and not by a semicolon? I though parameters are as statements and need to be separated each by a semicolon as in case of a for loop. I Am now confused as when to use comma and when semicolon when separating parameters of different functions!!!

  • @thehacker8454
    @thehacker8454 6 ปีที่แล้ว

    Do you have to put the number of elements in the square brackets or can you just leave them empty?

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

    Making prototypes above the main function and then writing a code of that prototype is redundant action. You just can write the function above the function main and it will work perfectly without making a mess in code by typping additional lines.

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

      I get it

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

      Thats funny because i was thinking the same thing,
      Couldn't he have just put the other function above main and would have been good to go?

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

      After 3 months I admit that making prototypes is even better. When you don't make prototypes you have to plan your code so that inner functions have to be above outer ones. By pointing out making prototypes compiler knows about existence inner functions so they don't have to be above the outer ones. Quite helpful, isn't it ?

    • @jrarmas321
      @jrarmas321 8 ปีที่แล้ว

      yeah so its sorta like a comment in a way? helping you understand your code or remember it correct?

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

      Not exactly. Commenting can be helpful, but has no effect on compiling. Declaring prototypes of your function tells the compiler that such function exists when is brought out without defining it above. This way compiler knows that there is no reason to panic since it reckons that if declaration was provided, definition will also be provided later.

  • @chrisp.401
    @chrisp.401 7 ปีที่แล้ว +9

    When I make sizeOfArray bigger than it actually is, it steals the value of arrays that were declared before. example:
    int amazingArray[5] = {16,19,22};
    int unrealArray[2] = {69,96,666};
    realityBreakingFunction(unrealArray, 7);
    output:
    69
    96
    666
    16
    19
    22
    WHAT"S GOING ON GUYS?

    • @yassinghareeb4074
      @yassinghareeb4074 6 ปีที่แล้ว

      interesting

    • @HaraldSangvik
      @HaraldSangvik 6 ปีที่แล้ว

      You're accessing memory after that array. All sorts of shit can happen :)

    • @HermanWillems
      @HermanWillems 6 ปีที่แล้ว

      These C++ lessons are awfull and it uses OLD C++. Nobody in the right sense uses regular Arrays. Everybody uses STD::ARRAY It's an containered array. It's safer, got more handy futures build in and just as quick.
      I defined the size of the array in an oldfasioned way like this:
      int bucky[3] = { 2,95,304 };
      int jessica[6] = { 45,46,78,34,45,2 };
      printArray(bucky, sizeof(bucky) / sizeof(bucky[0]));
      printArray(jessica, sizeof(jessica) / sizeof(jessica[0]));
      // Number of elements are total size of array divided by the individual sizes of the elements, because different types use different memory sizes.

  • @Michy20
    @Michy20 5 ปีที่แล้ว

    OMG you saved me! very useful!

  • @niranjanpradhan3364
    @niranjanpradhan3364 9 ปีที่แล้ว

    Hello Sir, Array can be overloaded or not,that means if we take two array with same name but different number of parameter,and we pass it through function call then it was not working.

  • @dickdastardly4835
    @dickdastardly4835 5 ปีที่แล้ว

    When I run jessica with a size greater than the functions size, it starts showing bucky's integers, but the reverse does not happen. What causes this?

  • @MacosauRAWR
    @MacosauRAWR 10 ปีที่แล้ว

    Is theArray[] a build-in function or so? How does it know it's Bucky or Jessica? Same goes with sizeOfArray.

    • @daymare7507
      @daymare7507 10 ปีที่แล้ว

      They're just the names of the local variables. Think about it like this.
      say you have myArray[5] that you pass into function x(int localArray[], int arraySize)
      localArray is now a carbon copy of myArray, but they're not the same exact array, if you change something in localArray and don't return it, it WON'T change in myArray. same with arraySize, if you're using it in a for loop there isn't a function or command that allows you to access the array size off localArray, so you have to provide it for the function.

  • @TheaDragonSpirit
    @TheaDragonSpirit 12 ปีที่แล้ว

    Can't get the Bucky O Hare song out my head now. Ha.

  • @shazaibmaqsood2957
    @shazaibmaqsood2957 5 ปีที่แล้ว

    bucky jani tu love ha

  • @alizawahry570
    @alizawahry570 11 ปีที่แล้ว

    Not codeblocks Its Dev-C++ available on sourceforge he mentioned it in the 1st tutorial

  • @jessicapeters3533
    @jessicapeters3533 6 ปีที่แล้ว

    First time I've seen my name as a variable - woo! :)

  • @jaredcubilla7770
    @jaredcubilla7770 10 ปีที่แล้ว

    Actually, you don't have to write things like bucky[5] anymore... C++ can count how many elements in your array, so your initialization no longer needs the [5].

  • @JCStelu
    @JCStelu 8 ปีที่แล้ว

    Somehow, I think it's a good practice to make sizeOfArray a const, just to avoid future changes into, that is to avoid getting funny things from compiler if you change by mistake the size of array in your external function.
    void foo( std::string name[ ], const int n) { ... }

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

    bad ass bucky, thx

  • @jyotiprakashnath1118
    @jyotiprakashnath1118 2 ปีที่แล้ว

    Really helpful

  • @leeonzo4535
    @leeonzo4535 2 ปีที่แล้ว

    Ok when I do it they change my array values to extreme values
    I changed the array from double to integer and still with the changing values
    What do you think is up with that

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

    Please help!!
    The autocompletion doesn't work on CodeBlocks for me (knowing that I have everything checked).
    How to overcome that?

    • @blinkerhawk
      @blinkerhawk 6 ปีที่แล้ว

      haha;; I like how you say overcome. You already figured it out I believe

  • @mohdad-fadhilmusa8394
    @mohdad-fadhilmusa8394 3 ปีที่แล้ว

    I don't understand, the variable x is not declared in the program but there is no error?????

  • @creativeknowledgemike2337
    @creativeknowledgemike2337 7 ปีที่แล้ว

    in the loop where it says thearray[x] [x] signifies the int right? since it is a int variable?

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

    how to find length of array when only array is passed into the function ?

  • @adam3416
    @adam3416 6 ปีที่แล้ว

    I know this is an old video but how would I create a function that takes a single-dimensional array, modifies it (for example, adds 1 to each element), and returns the modified array? It doesn't seem to be as easy as i would have thought.

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

      i'm pretty sure you would just add 1 to each element by going through it in the for loop, like myArray[n] = myArray[n] + 1, then print that element using myArray[n] or something

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

    probably you don't have a compiler..i suggest you download and use devc++ instead of codeblocks :)

  • @lobnahamdi4660
    @lobnahamdi4660 7 ปีที่แล้ว

    thank you !! you are the best :))))

  • @aaron171091
    @aaron171091 10 ปีที่แล้ว

    hi, i want to implement an application that reads a file, modify its content and write the modification back to the same file? how i can do that? would u please give me some hint?

  • @SFCNR
    @SFCNR 12 ปีที่แล้ว

    int sizeOfArray = sizeof( theArray )
    That's also one way!

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

    Hi, this might be a really silly question but why do we need to prototype the function? Im very new to this ;-;

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

      the prototype needed if function is defined under the main(), also you can just definde the function above the main() and dont use prototype. maybe i am a little bit late with it

  • @nutsbutdum
    @nutsbutdum 9 ปีที่แล้ว

    Why do we need the parameter int sizeOfArray in the void function, and is the loop function "really" doing any calculation(i.e. the increment statement x++)? Because when we run the code it just print out the elements of the array as they are.

    • @alexzota7378
      @alexzota7378 9 ปีที่แล้ว

      I believe you need that so you can check if x is less than sizeofArray

    • @zyn2046
      @zyn2046 9 ปีที่แล้ว

      No it isnt doing any calculations, all the loop does is print out the contents of that specific element. The reason you need the sizeOfArray parameter is so that your loop can know how many times to run but also to make sure you don't go out of bounds. (which is when you try to loop an index which does not exist. Possible reason for a crash.) Hope i helped, Happy coding :)