Questions tagged as 'ponteiro'

0
answers

Referencing a specific element of a bidimensional matrix via the pointer notation [closed]

C allows you to treat each row of a two-dimensional array as a one-dimensional array. As known, one way to reference two-dimensional arrays in the form of pointers in C is, for example: tabela[j][k] = *(*(tabela + j) + k) According to my...
asked by 11.11.2018 / 18:12
0
answers

how does a "const void * foo (param, param)" function work?

bool cmp(const void * a, const void * b) { return static_cast < /*type?*/ * > a < static_cast < /*type?*/ * > b; } const void * min(const void * first, const void * last, size_t size, compare cmp) { void * minor = * f...
asked by 27.09.2018 / 19:49
1
answer

Saving a linked list

Hello, I have some doubts that I will illustrate below: Having two doubly-linked lists A and B with the structure struct lista { Ponto* dado; /* dado = número */ struct lista *prox; /* ponteiro para o proximo element...
asked by 10.07.2018 / 19:30
0
answers

Vector of pointers in which each element is a row

Hello. I wanted to create a vector of pointers in which each element points to a supposed queue, but when I try to access the (vector of pointers) - > (TAD row) - > (vector within the TAD queue), I have problems, it does not access. Fol...
asked by 28.05.2018 / 01:27
1
answer

Problem with pointers - remove element in a binary search tree

You are having some problem in passing the root pointer per parameter to the remove_node This function is iterative, it has only one recursive call in the latter case. So you have to use two pointers. As we walk through the binary search t...
asked by 07.04.2018 / 23:35
0
answers

Add the diagonal of an array (pointers)

Can anyone explain to me what "a [i] + i" means? When i = 0 the pointer points to 2. But when i = 1 should not be [1] +1 = 4 + 1 = 5? In practice it points to 8 ... #include <stdio.h> #include <stdlib.h> int main() { int soma;...
asked by 07.04.2018 / 16:38
1
answer

How to pass a double pointer as an argument and return it from the C ++ function

I have a function that requires it to be void and that a double pointer is returned from it by the argument. void cracking::decompose(char input[][100], int size_S, double* &Atm, int* &ID, int &size_out); { vector<double&...
asked by 12.04.2018 / 19:38
1
answer

How do I pass a vector of struct per reference parameter?

(1) In the check_read function it is not printing the correct values I'm reading in the read_dates function, it's printing a bunch of random numbers and symbols. (2) If I solve the problem, how can I print all the surveys I've done? #includ...
asked by 25.11.2017 / 18:12
1
answer

Matrices and Pointers

Hello, how do I point to a multidimensional array? I know to do this with a vector (unidmensional array), it looks like this: int v[5]; int *ptr = v; I understand this very well, but with an array I can not do that. When I use the same tact...
asked by 05.11.2017 / 03:44
1
answer

Can anyone help me to value the positions of this array with pointers?

Hello, I am in doubt about the following code, it creates a two-dimensional array using pointers, the command line that should assign specific value to each position of the array does not seem to work, because when typing on the screen it appears...
asked by 05.11.2017 / 01:03