Questions tagged as 'ponteiro'

3
answers

Should I allocate the structure member date as well?

Assuming the following structure: typedef struct lnode{ struct lnode *next; void *data; int id; }Lnode; Let's say I want to store a Lnode in heap : Lnode *exp = malloc(sizeof(*exp)); Should I now also use malloc...
asked by 01.02.2016 / 17:36
2
answers

Problem with pointer deallocation in chained list

I have a problem with the deallocation of pointers in my code a few days ago. I try to make sure that the point of my on-screen object is greater than one value, move this object out of memory, but for some reason this is not working and is givi...
asked by 02.10.2015 / 22:28
1
answer

Saving names

I want to allocate a string inside any structure so I can fetch these strings afterwards. I need to enter a condition to end the insertion of names. I'm thinking of a structure that is running until the end of the reading, I think it would be a...
asked by 11.02.2016 / 03:51
0
answers

Pointers to Functions [closed]

I am facing a small problem with pointers to functions in a program for Microchip Pic Series 18 microcontrollers. The code shows the prototypes of two functions involved in the problem and a call to the function 'insert_tarefa', which MUST re...
asked by 24.09.2014 / 13:50
3
answers

How to pass a struct vector by reference parameter?

My question is, what is the error of this passage? It looks like the (*dadosCliente+i) pass is incorrect, does anyone know why? struct cliente{ char nome[50]; char endereco[50]; } void addCliente(struct cliente *dadosCliente, i...
asked by 03.02.2014 / 17:48
2
answers

Problem with pointer and array

I wanted to print the corresponding places and values from an array using a pointer, but when I ask the pointer to add the location of the vector with 8 (which corresponds to the 8 bits of an integer) program sums up values that I do not even kn...
asked by 06.10.2017 / 05:05
3
answers

Pointer to char in printf () does not work

I decided to make this code simple, where I have an empty vector and a function that fills it only with a letter that the user types, but I can not print. If I use that commented% com, it works, but if I print out it does not come out of the...
asked by 26.07.2018 / 03:17
2
answers

Memory Allocation and Pointers

I'm implementing a Sudoku, but I'm having a hard time filling it out. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include <stdio_ext.h> typedef struct grid_info {...
asked by 03.09.2015 / 06:11
2
answers

Calculate memory address by pointer arithmetic

Suppose the elements of the v vector are of type int and each int occupies 8 bytes on your computer. If the address of v[0] is 55000, what is the value of the expression v + 3 ?     
asked by 14.04.2018 / 22:07
1
answer

Why can not I access the data of this struct with the dot, only with the arrow?

I have alloted this struct by dynamic allocation and can only access the data idade via arrow and not by point wanted to know why? #include<stdio.h> #include <stdlib.h> struct pessoa { int idade; }; void alteraId...
asked by 21.12.2018 / 23:19