Похожие чаты

I think i get it, but not sure. By paasing

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?🤔

5 ответов

9 просмотров

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

Amir- Автор вопроса
Sunbro
u dont get what you mean by merging and so on, you...

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

Amir
Isn't that case when passing by value as well?🤔the...

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)

Amir- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
32
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Добрый день, не подскажите, если в OC-V3 поменять страндартную директорию /storage/ на /storage2/ - не будет сильно много проблем ?
Max Dubovsky
32
Книга Юрова В.И пойдёт для обучения?
Botsman
24
Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
25
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
I bought some PHA tokens on Kucoin, which is the best wallet to store and easy to use?
AMR
19
Can you believe it? A whole new gaming ecosystem powered by FunToken! 😲
Josh
13
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
Подскажите пожалуйста, а я могу вот такую штуку использовать? rpc, только реализованное в реббите https://www.rabbitmq.com/tutorials/tutorial-six-php ( или https://habr.com/ru...
Artyom
11
Карта сайта