Questions tagged as 'paso-por-referencia'

3
answers

Does Java support the passing of variables by reference? [duplicate]

When I pass an object to a method using a parameter, the object is passed by value or reference? The doubt comes by this code: int a = 2; cambiar(a); System.out.println(a); public static void cambiar(int c) { c = 10; } In the previou...
asked by 16.02.2016 / 02:54
1
answer

Avoid temporary copies in call to lambdas

I have the following class: class Utf8Writer { struct ZoneData { uint32_t begin; // codepoint inicial. uint32_t end; // codepoint final. }; const ZoneData *findCodepoint( uint32_t cp, FontId fid ); }; const ZoneData *Utf8Writer...
asked by 14.05.2018 / 11:15
3
answers

How to read strings of a structure passed by reference

This is my Structure typedef struct{ char Nombre[20]; }Cliente; And they ask me for a function that captures the name by means of the structure and performs this function void Captura_cliente(Cliente *client){ printf("Escriba...
asked by 20.12.2018 / 10:19
1
answer

How to make a pointer by reference in C

Well what I said in C ++ compiles this code for me without problems: void pasoPorReferencia(int *&referencia){ cout<<referencia<<endl; int *dir_cambio, m = 2; dir_cambio = &m; cout<<dir_...
asked by 16.09.2017 / 16:02
1
answer

Variable reference to object

In the function for the creation of a google chart in javascript I have the variable of a div on which I draw the graphic. The variable in question is containerDiv, which is a string with the id of the div. I would need, instead of drawing...
asked by 22.06.2016 / 16:09
2
answers

In Java, arguments are passed by value or by reference?

I always thought that in Java the parameters are passed by reference in the case of objects and by value in the case of primitive types. But there are sites where it is said that all parameters are passed by value, for example, here (in Eng...
asked by 18.12.2015 / 23:12