Questions tagged as 'c'

1
answer

C - How to pass a vector in which contains pointers to struct as a function parameter?

First I created a struct vector. Next I have created a vector of pointers, in which each element of this vector points to each element of the struct vector. Finally, I need to pass both the vector of structs and the vector of pointers as para...
asked by 17.09.2018 / 05:52
1
answer

Help with understanding cellular automaton code

I would like you to help me understand a code for calculating and presenting cellular automata that I found on the internet. The code in question is as follows: #include <stdio.h> #include <stdlib.h> void PrintfVetor(char vetor[],...
asked by 19.07.2018 / 07:06
1
answer

Why this C code is not working (binary tree)?

Good morning, I'm trying to create a recursive function that traverses a binary tree and finds the largest integer contained in the nodes. My idea is to pass the pointer to the tree node, and a pointer to integer, and this pointer to integer...
asked by 29.08.2018 / 16:17
1
answer

How to print the repeated name only once?

For one or two repeated names, it works fine, but if I make them all the same it repeats about ten times. I already tried to use flag, but I can not understand the reasoning. #include <stdio.h> #include <stdlib.h> /* Lucas Correi...
asked by 03.09.2018 / 15:58
1
answer

C / How to calculate the average in this program?

Hello, this program asks for a number of people, then stores information in the struct. My question is: How can I calculate the average height for the program? Calculation is commenting #include <stdio.h> #include <stdlib.h> int m...
asked by 29.08.2018 / 00:15
1
answer

Write access to the member of a structure with a pointer instead of using the "-"

How would you write this assignment: p1->caracter='B'; otherwise using * instead of -> ?     
asked by 29.08.2018 / 22:43
1
answer

Is the openssl / bn.h library part of the ANSI C standard?

I was looking for how to work as big numbers in and found a blog that says it was possible to work using the library, wanted to know if it is part of the ANSI C standard?     
asked by 05.06.2018 / 03:09
1
answer

How to assign array of characters in a structure?

The program reads 10 movies, each movie has genre name, and age rating, then the list; I can not assign array of string (I believe this is only this error) #include <stdlib.h> #include <stdio.h> #include <stri...
asked by 25.10.2018 / 22:37
1
answer

Arithmetic of pointers in C

I'm doubtful of a way to know the length of a vector without using sizeof : int n = *(&arr + 1) - arr; It is known that: arr is of type int ( * ) and (&arr + 1) is of type int ( * )[size] . Wha...
asked by 13.11.2018 / 03:01
1
answer

Error in one of the functions of the program that calculates a factorial

I can not fix the error of the last "factorial2" function, which in this case would be the factorial at the bottom of this calculation: Program:#include<stdio.h>#include<conio.h>doublefatorial(intn);doublefatorial2(intx,inty);intmai...
asked by 01.05.2018 / 18:56