Questions tagged as 'ponteiro'

1
answer

Struct address for INT

I have the following Struct: struct nodo{ int elo_a; char nick[26]; char cidade[16]; int idade; int elo_p;}; I have two struct assignments: struct nodo *variavel; struct nodo *offline; Okay, I already inserted a value in offline, sett...
asked by 07.11.2017 / 01:34
1
answer

How to transform pointer into array

I'm doing a program that transforms an array into a transposed array. I'm using 3 functions because I want to learn how to pass parameters from arrays . The main() function calls the mValores function that prompts the user for...
asked by 08.10.2017 / 18:26
2
answers

Is it possible to assign the first column of a line of a / a vector / matrix?

having as example a vector of two dimensions of type char 2x2: char vet[2][2]; Is it possible to assign to the first line indices of this vector? or do they work like a pointer to the other rows and columns? I tried to do it as fo...
asked by 07.09.2017 / 22:54
1
answer

Function per parameter does not modify variables

I built a binary tree class in which I have a bfs function that runs through it. As a parameter this method gets a void (*Op) (node_BT <type> *) function pointer that will be called inside the bfs itself: #pragma onc...
asked by 23.07.2017 / 06:58
1
answer

Problem with char returning strange characters

The intention is to replace all words toda with 0 , however after X characters it begins to return strange values as can be observed in the comments. I think I'm handling the parameters wrong, but at what point? Why? #include&l...
asked by 03.06.2017 / 18:06
1
answer

Problems with dynamic and struct allocation

I want to create a struct where there will be a vector of structs ... The way I thought about doing this was something like this: typedef struct{ char *teste_str; int teste_int; }TESTE_A; typedef struct{ TESTE_A **t;...
asked by 21.05.2017 / 15:33
1
answer

How can I pass a file descriptor to another process?

I recently read a Peter Hutterer post explaining about a new protocol called inputfd that is intended to forward a file descriptor directly to other processes without the composer's interaction. I was curious, how is it possible to pass a f...
asked by 17.04.2017 / 20:10
1
answer

Accessing a pointer pointer (c)

Why when dropping a level on the pointer pointer ** lista / * lista we should use the parentheses: ( * lista ) , I ask the question because I saw in some internet examples that they did not use and also in an old book that I...
asked by 17.04.2017 / 23:04
1
answer

Modify = 2D array using pointers

I would like to modify my array (multiplying by 2 each of its elements) using pointers, but I do not know why my code is not working ... #include<stdio.h> void changematrix(int **mm,int row, int column) { int i,j; for( i = 0;i &...
asked by 18.04.2017 / 06:21
1
answer

Error when trying to get data from a .txt file and move to a queue in C?

I can open and move through the file the error happens when I try to point to the beginning or end of the queue, someone tell me if the pointers are correct typedef struct lista { int info; char infoP; struct lista* prox; }Lista; typedef stru...
asked by 11.04.2017 / 20:51