Questions tagged as 'ponteiro'

2
answers

How do I correctly access elements of a dynamic array via pointer?

As many know (I believe) a multidimensional array is stored in memory in a linear fashion, ie each row of the array goes into memory one after the other. For example, I created the following image: Soyoucanmanipulateamultidimensionalarrayasi...
asked by 08.06.2018 / 03:27
1
answer

Write list in binary file

The idea of this method is to write all words from a list of nodes in a binary file. I have a linked list of nodes, where each node has two information, its information, and a reference to the next node in the list. The idea is to write the info...
asked by 26.11.2015 / 11:51
3
answers

How to access a pointer inside a structure?

I need to know how to access the first position of the vector of pointers * c_parte_real, as shown below: typedef struct{ struct char_vector{ char *c_parte_real[2], *c_parte_imag[2]; }c_vector; struct int_vector{ int *i_...
asked by 19.12.2016 / 02:34
1
answer

Pointers with methods, where am I going wrong?

Creating a class that will have two methods one assign another to print vectors with public and then call that method in main . I've been able to do this with the baby steps method. Where am I going wrong and what do I have to...
asked by 08.03.2014 / 21:34
1
answer

C struct pointer

What happens is the following, inside the ins_ult() function I can change the value of root->data , but outside the function the value remains NULL . Am I passing the parameter wrongly or using malloc incorrectly?...
asked by 21.08.2014 / 02:28
1
answer

How to use realloc () dynamically in struct allocation?

I have a struct TMedidorEletrico *medidor; structure, and it is necessary to reallocate the memory for this structure dynamically until the user closes the loop . Memory must be relocated one step at a time , but when invoking the fun...
asked by 16.09.2015 / 01:52
1
answer

Nested pointers and references

I have a question in interpreting (in the form I read my code) in assignments in pointers in the C language. I did not understand the logic of the following assignments: "If i and j are integer variables and p and q...
asked by 06.09.2015 / 19:13
1
answer

Understanding pointers [duplicate]

I'm trying to learn C ++ from the internet, I understood more or less what pointers are but I do not see a utility, I do not know anything about C ++. I just do not want to go over this subject, I did a test that I think should work, to see th...
asked by 06.07.2015 / 00:55
2
answers

How is a variable pointed to a pointer?

Reading this answer about pointers and arrays in C, there is the example below where the variable ptr points to the first element of this array . int array[42] = {42}; int *ptr = a; How does this pointer identify the first eleme...
asked by 08.10.2015 / 15:41
1
answer

Why am I having access to this pointer even after giving free?

I have this program and theoretically was not to lose the address of new after giving the free making it inaccessible? #include <stdio.h> #include <stdlib.h> typedef struct{ int numTeste; }strPt; int main (){ strPt * new...
asked by 30.03.2018 / 03:32