Questions tagged as 'ponteiro'

1
answer

Insert node in binary tree

How to insert a node into a binary tree? Always gives segmentation error when code enters if (arv == NULL) struct no { int info; struct no *esq; struct no *dir; }; typedef struct no node; struct node *insere (node *arv, int...
asked by 16.03.2017 / 23:55
1
answer

Vector of struct in C

I can not find the error in this code of my exercise. It prints right the first reading, then prints random things. I could not find out if the error is in the reading or the printing. #include <stdio.h> #include <stdlib.h> /*Defin...
asked by 26.12.2016 / 01:16
1
answer

Error importing structs from a header file

I need to use the following structures without changing their implementations from a .h file. typedef unsigned long int chave_t; typedef unsigned long int conteudo_t; typedef struct entrada_hash{ chave_t chave; conteudo_t * con...
asked by 10.04.2016 / 18:37
1
answer

Problem with split function in C

Hi, I'm studying C language and I came across a pointer problem in a string breaking function. I use the 4.8.4 GCC version. The input value that results in an error is "1234 | 123 | 123 | 123" 4/3/3/3, other values such as "1234 | 123 | 123 |...
asked by 04.02.2016 / 16:07
1
answer

Error undefined reference when trying to use a template class

I have a Set template class and a Menu class both with their respective .cpp and .hpp, when trying to use a pointer of the set class in my Menu class I get the following error: ||=== Build: Debug in Trabalho04 (compiler: GNU GCC Compiler)...
asked by 04.12.2015 / 22:20
1
answer

How to pass a function pointer per parameter?

I need to be passed by argv[] , in the main function, the name of a function that will be called by it. I can not make comparisons of strings , so I should make the call with variables. Here is my code: typedef void (*func)(void);...
asked by 25.11.2014 / 03:44
2
answers

Error accessing pointer

int main() { int**items[5]; for (int i=0;i<5;i++) { *items[i] = new int; <-- } return 0; } The program compiles, but does not rotate. I ran the debugger and pointed out that the error is where the arrow poin...
asked by 23.09.2014 / 13:26
2
answers

Problems inserting values into vector pointer

I'm having trouble trying to perform a programming exercise that was passed to me, where you are asked to "create a vector-type pointer variable with 20 character-type occurrences". #include <stdio.h> #include <conio.h> int main()...
asked by 27.11.2014 / 04:20
0
answers

Nested Struct - Difficulty in understanding the concept

I have the following structures: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } List; I made a dra...
asked by 08.12.2018 / 01:03
1
answer

Doubt - Dynamic List

I have the following structure for my dynamic list: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } Li...
asked by 11.12.2018 / 02:04