Questions tagged as 'ponteiro'

2
answers

If array is the same as pointer, why does one need to be copied to one variable and another need not?

In this answer bigown said that if the frame member was a pointer you do not need to copy the string into it. But arrays are not pointers? Why is it different?     
asked by 02.02.2017 / 12:35
1
answer

Getting different results with passing by value and passing by reference

I'm testing these code examples in C: Call by value #include <stdio.h> /* function definition to swap the values */ void swap(int x, int y) { int temp; temp = x; /* save the value of x */ x = y; /* put y into x */...
asked by 25.05.2016 / 03:45
1
answer

Correct use of free () in function?

How to use free() function when it is used inside a function, in this function it generates a dynamic vector and itself will be the return of the function, eg: int* copia(int *vet, int tam) { int i, *retorno; retorno = (int*) ma...
asked by 05.12.2015 / 18:25
1
answer

How to use the pointer concept in php?

I'm learning about pointer in C language and I already know how to use it. I think the way to use pointer in php is the same in C. But how do I make pointer declaration in php?     
asked by 24.09.2014 / 19:50
1
answer

Is it possible to use pointers in VB.NET?

Is it possible to use pointers in VB.NET? If so, how do they work? An example in C++ : CSR = ConfigurarInterfaceDeRede(randInt(0,999999),CodAtivacaoSAT,(char*)xml); int a; int *p; p = &a; How would you translate this to VB...
asked by 04.12.2014 / 13:12
2
answers

Why is the value in bytes displayed as 4?

I'm using a 2x2 array with a simple pointer and I want to display the values of it. #include <stdio.h> #include <stdlib.h> typedef struct matriz mat; struct matriz { int lin; int col; int *arr; }; mat* cria(int lin,...
asked by 05.04.2017 / 04:03
1
answer

I can not print, in the main function, values coming from a vector created in another function received by a double pointer

The following source code is the miniaturization of a major problem that I am working on, and I have not been able to solve the problem for two days. I need to print the values of the vector generated by the "makeVector" function, in the "mai...
asked by 03.06.2018 / 21:05
2
answers

Segmentation Fault (core dumped): array reading

I have a problem with reading an array that produces the error    Segmentation Fault (core dumped) This is just the beginning of code development, but it already has an error after reading the first element of array . #include <st...
asked by 22.03.2015 / 14:55
2
answers

Where is the function for which a fallen lambda for pointer points stored? How is it released?

I recently learned that I can do this: auto a = +[]{return true;}; a = +[]{return false;}; And I understood that a lambda that does not capture anything may fall to a pointer to function, as confirmed by GCC : bool (*)() Bu...
asked by 28.07.2016 / 04:08
1
answer

Golang - Doubt over pointers

I have a struct called Calculator, with two properties: version and author. In order to instantiate this struct already initializing these methods, since Golang does not have constructors, the various tips that I found in the net indicate to cre...
asked by 04.11.2017 / 01:02