Questions tagged as 'c'

1
answer

Output a void function

I'm programming a word hunting and a problems in the void function is making it difficult. In the code I use functions to scan the array in all directions and returns me the start and end coordinates or exit the function and start reading in ano...
asked by 30.09.2016 / 04:22
2
answers

How do I compare two strings in c

Basically what I want to do. It is to receive a String on the command line. Only with the String entered, they have to be in the binary base, so I do an if to check if it is binary or not. My problem is in the if, because regardless of the value...
asked by 23.09.2016 / 23:44
1
answer

Error in vector calculation in C

I am refactoring my code to make it more dynamic, but by including the line int n = sizeof(vetor)/sizeof(int); within the function bubble it no longer works correctly. Where am I going wrong? Modified Code void bubble(int ve...
asked by 25.02.2018 / 20:30
2
answers

Segmentation Fault with malloc

Good morning! I'm doing a program, and in a part of it I need to create a vector full of zeros the size of the range entered by the user: scanf("%ld %ld", &n1, &n2); int *vetor; vetor = malloc((n2 - n1 + 1) * sizeof(long int)); for (l...
asked by 25.08.2018 / 13:06
3
answers

C - how to calculate the factorial of a number? [duplicate]

To try but I can not, for example: the factorial of 5 is given by 5 * 4 * 3 * 2 * 1. You have to develop a program that calculates the factorial of a given number as input. (using for)     
asked by 26.01.2018 / 18:33
1
answer

I need help to create the makefile

# Baseando-se no link: https://www.embarcados.com.br/introducao-ao-makefile/ all: bancoBPE bancoBPE: main.o gcc -o bancoBPE main.o -Wall -Wextra -Werror -Wpedantic # Não sei direito como compilar esse structs.h sozinho sem ter structs.c s...
asked by 05.12.2017 / 19:24
1
answer

Correct answer however uri does not accept

I'm starting to study pointer and I decided to change my codes to use pointers, but I tried to send that solution to uri and he gave a message - In queue - I do not know where the error is, why the entries I tried give the solution that the pr...
asked by 02.01.2018 / 05:50
1
answer

Segmentation fault (core dumped) when accessing String

I've assembled the code below to separate only the last few characters of a link (the last 11 to be more exact). Until then everything works well, the calculations are done normally, the values also beat. The problem is at the time of giving...
asked by 09.01.2018 / 01:51
2
answers

error: can not convert 'int *' to 'main () :: class *' in assignment

I am trying to compile my code and it presents the error informed above    error: can not convert 'int *' to 'main () :: class *' in assignment ' in line 21 (ptr_turma =(int*)malloc(sizeof(int)*100);) Follow the code: #include...
asked by 02.05.2018 / 03:22
1
answer

Struct! You are giving error on line 47 at the time it compiles, Follow the program in c

#define MAX 50 struct{ int ra; char nome[MAX]; float prova; }aluno[5]; int main(){ struct aluno; int i; int j; printf("Determine o Nome do Aluno %d: ", i+1); printf("Determine a Matricula do Aluno &d: ", i+1)...
asked by 17.06.2018 / 02:18