Questions tagged as 'ponteiro'

3
answers

Error in pointer return in function

Well, I have the following error: Incompatible types when assigning to type 'char [30]' from type 'char *' The code is as follows: int main() { char *resultado[30]; float valor = 12735.98; resultado=monet(valor); \O AVIS...
asked by 15.05.2015 / 01:38
1
answer

Pointer to struct within a struct

I can not assign value to a variable of a pointer of struct within a struct . My structs : typedef struct notas{ float geral; float especifica; }Notas; typedef struct data{ int dia,mes,ano; }Data; typedef st...
asked by 25.11.2014 / 20:14
1
answer

Function that returns pointer crashes when it tries to return pointer to main program

I have this function that retrieves a record of a binary file already filled with records - such records are structured as node - and returns it to the program. However, in the return from "i" to the main program variable "test", the two being...
asked by 12.12.2014 / 15:45
1
answer

Array of pointers with struct

I am trying to assign 3 names to a string vector within a struct, and using pointers to reference the dynamically allocated struct, and then print and reverse it in a repeat structure, but when trying to print it it is not returned nothing....
asked by 10.11.2018 / 00:09
1
answer

Statement of Pointers in a struct and calling it in function

I should solve the following problem by creating a function for reading, one for calculation and use pointers. #include<stdio.h>#include<stdlib.h>#include<math.h>structponto{intx;inty;}ponto1,ponto2;structponto*p1,*p2;p1=&a...
asked by 18.05.2018 / 13:50
1
answer

Error converting 'int' to 'int *'

I wanted to know why you are causing the error:    Error converting 'int' to 'int *' This program is only for training the use of pointers in parameters. void teste(int *t){ *t = 50; } int main(){ int x = 10; cout << "Sem u...
asked by 30.04.2018 / 02:24
1
answer

Syntax errors in C [closed]

I'm doing this exercise in C, but I caught that part of passing pointer parameters. Basically the program below adds the portion of real numbers and integers. The problem is that the current results are: a = 12 (correct!) b = 10 (...
asked by 31.05.2018 / 18:55
1
answer

Principle value of a struct through pointers

I want to print the "attribute" name of a struct of type "Person", however the printf returns (null) but I declare the name of the struct. Here is the code below: typedef struct pessoa{ char *nome; struct pessoa *pai; struct pessoa *mae...
asked by 19.05.2018 / 04:46
1
answer

Not booting error

I'm having a non-boot error, and I can not figure out why: #include <stdio.h> int main(){ const int LENGTH = 10; const int WIDTH = 5; const char NEWLINE = "\n"; int area; area = LENGHT * WIDTH; printf("Value of area : %d", ar...
asked by 12.12.2017 / 21:51
1
answer

Doubt in a question of pointers in C

The question is this: Construct a function that takes two integer values a and b , return (passing by reference) the quotient, div, and the remainder division, mod, from a to b . The function should return -1...
asked by 03.11.2017 / 22:35