Questions tagged as 'ponteiro'

1
answer

How to allocate a member of a struct in C?

I would like to know if it is possible to allocate a atributo of a struct , follow my struct example: struct MinhaStructExemplo { int * atributo_quantidade; /*Atributo que eu gostaria de alocar na memoria*/ }; For the...
asked by 27.11.2015 / 00:35
2
answers

Pointer to struct

I was studying pointers to struct , and I saw that there are two ways to use it. can be: (*ponteiro).variavel Or: ponteiro->variavel According to what I read, when we put *ponteiro.variavel , because of the order of prec...
asked by 19.10.2018 / 18:41
2
answers

How to create an index file using tree B +

I have a B + tree that acts as the index of a data file. This index should be saved to an index file. The struct node or node of the B + tree is: typedef struct node { void ** pointers; int * keys; struct node * parent;...
asked by 16.12.2014 / 17:32
4
answers

Memory allocation for pointers

I've been reading and studying pointers and I came across the following quote in a book: "Although it is possible to use them as vectors, pointers do not have their own memory. Pointing can only be used after a pointer is pointing to some obje...
asked by 17.08.2015 / 12:37
2
answers

Sizeof () or strlen ()?

sizeof() or strlen()? What's the difference between using them in char pointers? which is more appropriate?     
asked by 29.07.2016 / 20:23
2
answers

Pointer changes address when exiting function

When performing a dynamic allocation of a vector or matrix in C, the pointer referring to this allocation changes address when leaving the function, whereas before it was pointing to the initial address of the allocated area and soon after the e...
asked by 09.11.2016 / 20:17
2
answers

Function returns pointer to garbage, and free locks the terminal

Can anyone explain to me why I give free in pontaux the Windows terminal stops responding? And why when I pontmaior my result comes as memory garbage? The function returns a pointer to the largest value of a vector. Co...
asked by 08.02.2014 / 01:41
3
answers

Doubt regarding pointer

I have a question regarding C. Because when I declare as argument in function main: char* argv[] instead of char argv[] I can access the information. I know one is a pointer. Because I can not access when it is not a pointer. #in...
asked by 11.04.2017 / 17:31
2
answers

Why does not the pointer increase the value?

Here was to increment the value of the variable, but it does not work. #include <stdio.h> #include <stdlib.h> int main() { int *p, x = 10; p = &x; *p = (*p)++; printf("%d \n", *p); return 0; } Result:...
asked by 28.07.2016 / 03:46
1
answer

Strange values in output when running newly compiled application

When I compile and run this code in Linux , it shows a strange result. I think it's rubbish from memory. What is happening to him to show this result, and how can I resolve it? Command lines to compile code gcc -c aluno.c gcc -c test.c gcc...
asked by 04.11.2016 / 22:54