by reference the method code will be merged into the main function or any function that it will be called in and executed there, right?🤔
u dont get what you mean by merging and so on, you might want to look up passing by reference vs passing by value the essential difference is that when you are passing by reference the passing instance must be definded beforehand and you are usually saving the costs of the copy operation
More like passing by reference only copies a pointer, and not the rectangle itself
Isn't that case when passing by value as well?🤔the instance should be defined before hand either way, right? I'll look it up more, the notes that i took from the course few days ago says these stuff, guess i'll watch them again or just look it up online
Let's say your rectangle object takes up 10MB Without the pointer, you would be copying 10MB into the stack and then running the function (jumping to the function code) With the pointer, you copy 8 bytes (1 pointer) into the stack of the function, and then run it (the pointer pointing to the 10MB already in memory somewhere else)
Uh huh, i got it
Обсуждают сегодня