Questions tagged as 'c'

1
answer

Using stack concept to invert words

I'm doing a work on Algorithms and Data Structure, which uses the concept of stack to do the inversion of words. However, when compiling the program, it is pointing out some errors that I do not know how to modify them. Note: I have marked th...
asked by 12.03.2018 / 07:22
1
answer

Recursion in C: Summation

I'm learning Recursion in C, and I need to do a recursive function that returns the sum of any n number. The function prototype is float somatorio(int n) and the sum to be calculated has the following formula: Σ (from i = 1 to i = n)...
asked by 16.06.2017 / 02:12
2
answers

How to match a vector from an array with an array in the main function?

I need to match an array that is returning a function to an array in the main function. My goal with this is to be able to pass this same array as a parameter to other functions without having to be calling the function at the time of sending th...
asked by 12.09.2016 / 02:11
3
answers

Doubt about the lower value of the notes

I have a question about the conditional test to store the smallest value, it is not a doubt, the problem is that when it prints, the value of the smallest value gets 0.0, which impairs to calculate the average correctly, at the highest value it...
asked by 06.10.2016 / 19:29
1
answer

How to perform an operation without showing the result in C?

I need a way for the program to run an account between variables x and y and save the result to a z variable, how do I do this in C ?     
asked by 01.04.2016 / 02:11
1
answer

Function reverses numbers in array

How does this function work in c that inverts the numbers? void inverte(int vetor[MAX], int n) { int i,aux; for (i = 0; i < n/2; i++) { // troca posicao i por n-1-i aux = vetor[i]; vetor[i] = vetor[n-1-i]; vetor[n-1-i]...
asked by 04.03.2016 / 00:58
2
answers

Vector that generates elements

I would like to generate a vector where its next position element is added by 1. For example: be vetor[3] , I'd like v[0] = 1 and v[1] = v[0] + 1 , v[2] = v[1] + 1 , and so on. How would you do that? Follow my code fo...
asked by 07.11.2016 / 18:42
2
answers

Extensive array causes the program to stop working

I have the following problem, when I define an array that is too large, for example: int matriz[2000][2000] , compile and command to run, the program stops working. I just tested it in Windows and it appears that classic message ".exe has...
asked by 10.10.2015 / 15:11
2
answers

Compiling C for gross binary

How to compile a code in C down-level? (.bin, example). I am using the IDE Code :: Blocks, and the compiler minGW (I am in Windows, but if you know for Linux the commands are almost identical).     
asked by 16.10.2015 / 16:56
2
answers

How to sort an alphabetized list alphabetically?

I have to make a program that creates a linked list containing structs with information from a participant (name, cpf ...). I have done the insert function and I want to sort the linked list in another function called sort. But the program...
asked by 15.10.2015 / 15:34