Questions tagged as 'ponteiro'

2
answers

Pass array as pointer

I need to make the proposal:    Construct a function that takes parameters from a pointer to an array, the number of rows and columns, and prints the array elements. But I'm learning pointers and having difficulties, I've tried in several...
asked by 15.11.2016 / 02:34
1
answer

What is -EPERM in C?

What is the -EPERM , after which compares if the p pointer is null if(p == NULL) return -EPERM ; And I have to put these two libraries. #include <errno.h> #include <stddef.h>     
asked by 23.04.2016 / 17:28
1
answer

Dynamic Pointer Allocation in C ++

I need to create a protection routine in the removal function. Why did you make an error removing the last item? The function: // Remover o primeiro cliente void cadRemover(){ lista=ini; // Volta ao início aux = lista; // Copia o 1º p...
asked by 09.08.2014 / 14:12
1
answer

Why does a parameter have two const's in its declaration?

I'm reading the tutorials on the OpenCV lib site and during reading I saw the declaration of a function with a variable in a format I've never seen. I wanted to know what it means, declare the variable this way. I will post only the prototype of...
asked by 19.01.2017 / 01:44
1
answer

Pointer to struct for struct

Hello, I had asked a previous question about this problem, but I managed to solve it but did not learn about the problem itself so I tried to isolate it by creating a specific code for this problem and I would like someone to teach me what is hap...
asked by 27.05.2016 / 06:39
1
answer

Function to sum elements of a vector does not return correct value

I am making a program for a shopping list, the user passes the values of each product to the program and each one is stored in a vector. Then I add the elements of the vector to give the total value of the purchase, on that I created a function:...
asked by 20.08.2016 / 19:52
1
answer

Difference between cast of structures

struct a{ int a; int b; }; struct b{ int a; int b; } int main() { struct a *p; struct b b; p = (struct a *)b; // deste modo da erro p = (struct a *)&b; ; deste modo o compilador não aponta erro; } Would you li...
asked by 31.01.2016 / 22:09
1
answer

Switch large case in C

I am developing a system for college and would like to know the best option, in the sense of code optimization, even improvement. I have switch case for Menu, where I have 88 cases. I have a screen called "Help", in this screen, the...
asked by 11.11.2015 / 14:25
1
answer

Pointer can not be reset to NULL within function

Hello everyone! I was studying binary trees and needed to create a function that would remove any nodes and their children. However, when I did this function with return / 1 / the node was not removed. Copying the return of another function fr...
asked by 26.12.2015 / 03:40
1
answer

Access attributes of a vector of objects of another class using C ++ pointers

I'm doing a job for college where I have to set up a program to manage a restaurant that only delivers the orders are made by phone and internet using object orientation and pointers in C ++. I'm doing the following: I use two files for ea...
asked by 19.09.2015 / 19:40