Questions tagged as 'ponteiro'

2
answers

pointers casting

I can not understand why casting between pointers has some impact on the code, and just to leave the code readable, for example, this line of a function: void* getPhysicalAddress (pdirectory* dir, uint32_t virt) { ... ... return...
asked by 04.08.2016 / 20:26
2
answers

Pointer changes the value inside function in C ++

I have the task of creating four functions that do multiplication, division, addition and subtraction between two numbers given by the user. The operation to be performed must be chosen using the * / - + characters, given by the user. I need...
asked by 06.04.2017 / 20:21
2
answers

PHP - Foreach self-tuning

During development, there are many times when a request is made to the database, in which the returned data comes in array, sometimes it is necessary to perform a foreach to adjust this data or even include more data of according to a spe...
asked by 18.09.2015 / 19:24
1
answer

Line break when typing entries

I have a vector of structs with 10 people and I want my registration function to receive only one person at a time. At the terminal, the first person's registration is done correctly but after I get this "break" line, it jumps alone from the...
asked by 22.12.2015 / 14:55
1
answer

incompatible pointer type

Hello, programming / studying the language, C, I came across the following error warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] int *ponteiro = &x; Being the code: #include <stdio.h> void...
asked by 26.12.2018 / 03:48
1
answer

Vector struct and pointers

I have to get data (name and phone) from some people in a struct , then store them in a vector, all by a function / procedure. At the time of printing some strange characters come out. I'm using the C ++ DEV platform # include <std...
asked by 15.10.2014 / 23:51
1
answer

C pointers

Well guys, I'm doing graph theory in C, and I've tried using dynamic allocation to create an array. Also, my code has a function to populate the array with 1 in the received indexes. However I have some error in the array allocation or in its pa...
asked by 17.08.2018 / 22:07
1
answer

C - How to pass a vector in which contains pointers to struct as a function parameter?

First I created a struct vector. Next I have created a vector of pointers, in which each element of this vector points to each element of the struct vector. Finally, I need to pass both the vector of structs and the vector of pointers as para...
asked by 17.09.2018 / 05:52
1
answer

Why this C code is not working (binary tree)?

Good morning, I'm trying to create a recursive function that traverses a binary tree and finds the largest integer contained in the nodes. My idea is to pass the pointer to the tree node, and a pointer to integer, and this pointer to integer...
asked by 29.08.2018 / 16:17
1
answer

Write access to the member of a structure with a pointer instead of using the "-"

How would you write this assignment: p1->caracter='B'; otherwise using * instead of -> ?     
asked by 29.08.2018 / 22:43