Pointer Passing in C (systems & general)

Pointers are commonly used because they greatly reduce overhead. Instead of passing around 10, 100, or 1000 bytes of text to modify, you can just pass an 8 byte pointer to the start of the text, and dereference it when you want to access the actual text. This is just one of many advantages.

Oh wow, that actually makes a lot more sense - that's the pass by reference rather than pass by value right? Something like Java (ignoring the automatic garbage collection) would have to pass the whole 1000 byte array and not have control over when that memory gets released, right? Also, about scanf, sorry, the actual definition is int scanf(const char *format, ...) but basically the question remains, why pass a pointer? Also, is there any good list explaining other use cases/advantages?

/r/learnprogramming Thread Parent