Questions tagged as 'ponteiro'

1
answer

How to manipulate a vector of structs in an external function? Follow example

I am doubtful in an issue. The following is the statement: Implement a library control system with functions to register, query, change, and remove books. The attributes of a book are: Name (Book title, with spaces) Author (Full name...
asked by 04.07.2017 / 22:59
1
answer

Vector of struct and pointer to char

Why this syntax is wrong: #include <stdio.h> typedef struct { char* nome; char* numero; }Agenda; void adiciona(Agenda* reg, int i) { scanf("%s", reg[i]->nome); scanf("%s", reg[i]->numero); } void imprime(Agenda*...
asked by 03.06.2017 / 00:22
1
answer

Creating dynamic lists dynamically and saving their addresses (start of list)

Hello, I'm doing a college work on Hash table and I'm having some difficulties. I'll try not to complicate too much (to tell you the truth, running my code helps me understand what I want to do). Basically, I have, for now, a program that gen...
asked by 27.04.2017 / 02:18
1
answer

How to use pointer and vector in a single struct in C?

I can not run a program that needs functions to execute a procedure, this function receives a vector of type struct through a pointer. It does not have a compilation error, but the program crashes when it runs and does not work. How do I use all...
asked by 05.06.2016 / 02:32
1
answer

Help with nested structs in C

I was creating a list with C and using a struct , after finishing I tried to see what was changing with a nested struct , I created two structs basic, one getting only one value, and other receiving this first and a...
asked by 24.05.2016 / 06:34
2
answers

Why declare pointer to array if arrays are already pointers?

If a char array is already a pointer, why declare a pointer to the array? And what's the difference between char exemplo[10] and char *exemplo[10] ?     
asked by 08.10.2015 / 03:19
3
answers

Dynamic allocation with a void function

I made a simple code using dynamic allocation. Just ask for the size of the vector, to insert data and print it at the end I can do dynamic allocation with int , returning vet , but as I'm learning, I'm trying to do a few differen...
asked by 28.07.2018 / 23:40
1
answer

Operator & e * in functions

What is the meaning of this & in the front of the array (my function only works with & amp ;, I'm overloading cout <
asked by 03.10.2016 / 07:14
2
answers

Error invalid conversion from 'int' to 'int *' using -fpermissive

I'm following a series of C-videos ( link ), but I've encountered a problem. First I ran this code: #include <stdio.h> int main(void) { int x = 10; int *resultado; resultado = &x; printf("Valor &x = %d", resu...
asked by 12.11.2015 / 01:32
3
answers

Problem with pointer and recursive function

The code is this: Node * search ( Node ** root, int mats ) { if ( ! ( * root ) ) { return NULL; } else { search ( & ( * root ) -> esq, mats ); if ( ( * root ) -> person.mat == mats ) {...
asked by 14.06.2017 / 02:31