Questions tagged as 'c'

2
answers

Hiding bombs in a minefield with ASCII 2

Using a two-dimensional array, create a program to implement a minefield game. To fill the array positions, use random numbers so that 0 represents a free position and 1 a pump. The user must be able to commit 3 errors. Free chosen positions sho...
asked by 11.10.2017 / 12:26
0
answers

Problem with program to revert WAV audio in C

I'm doing a program to revert (let go forward) a WAV audio given as input, however my program stops working and I can not find where I'm going wrong. Follow my code: header: #ifndef WAV_H_ #define WAV_H_...
asked by 21.10.2017 / 21:39
2
answers

Split list double chained with head

I'm having a problem with the Divide function, where I'm getting a list and want to return the right part and the left part of the list. Can someone give me some help with logic. #include <inttypes.h> #include <stdio.h> #include &l...
asked by 03.10.2017 / 15:00
0
answers

Serial interrupt problem USART UDRE for ATMega328p

I'm having trouble using a USART serial interrupt in a program made in pure C and run on Arduino (Atmega 328p). My application requires pure C for efficiency and speed reasons, but I still want to maintain serial communication for debugging a...
asked by 30.10.2017 / 02:12
0
answers

Problem with my horizontal bar

I'm having problems with my horizontal bar, the problem is that it is not increasing the value of the "iVar" variable from 1 to 1, it's increasing by 5 or even more depending on how much I spend in the iMax value, How do I fix this problem? #d...
asked by 12.10.2017 / 02:28
0
answers

Undefined reference to

I have a program that is divided into its main , city.c and city.h . Main: #include "city.h" int main() { FILE *entrada; FILE *saida; Cidade *cidades; entrada = fopen("entrada.c", "r"); int numero...
asked by 06.10.2017 / 16:19
0
answers

Doubt on printing results

The exercise asks me to print, in a file, all possible paths between n cities, where the end is always the starting point and each city is represented as (x,y) coordinates. This first part I was able to do, resulting in the followi...
asked by 24.09.2017 / 23:48
1
answer

Checking for code matching in a vector within a struct in C

Next, I've created a struct struct eventos { int codigo; char data[11]; char atracao[50]; int ingresso; float valoring; }; And so, I created a vector that way struct eventos ficha[5]; My goal is to check inside a f...
asked by 24.09.2017 / 21:33
1
answer

Cycles in graphs

I am creating an algorithm that identifies if a graph contains cycles deleted the fonts recursively, returning the graph for later verification of the amount of edge, for this create the following code for adjacency matrices: Graph GRAPHisCycl...
asked by 22.09.2017 / 02:36
1
answer

The r + mode in C for files does not create the file if it does not exist? [duplicate]

I'm working on this code below and would like to store some random vectors in a file. From what I've read r + reads the file and writes to it, and if it does not exist it will be created. Well ... It turns out that when I use the code in the w...
asked by 07.09.2017 / 14:57