Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (11)

Sign In or Sign Up now to post a comment!
  • Ya. Seriously. We appreciate your help but you aren't a college professor and I don't want to pay like 20 or whatever dollars if I only need a vid here and there.

  • why dont you just use the sizeof operator?

  • another bad joke

  • Previous part: youtube.com/watch?v=G4uioaFmU3­k

  • Comment removed

  • We need the rest of the tutorial?

  • @czarkefa80

    Use sizeof() operator inside malloc. I.e. for: int array[1000] you can write: malloc(1000*sizeof(int)), thus allocating [(1000*4) = 4000] bytes of memory on heap (whatever heap is lol).

  • @doubleja Haha thanks :). The heap is free memory that floats around, as opposed to the stack, which is a set of memory that is automatically allocated. We get what's called stack overflow. I hope this helps. Yours helped, so cheers.

  • Thanks for the tutorial you explained it really well!! I have a question though, how can i allocate memory for a matrix, lets say i recieve an integer N from command line how can i allocate memory of size N*N?

  • whr's the rest of the tutorial?

  • Comment removed

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more