Questions tagged as 'c'

2
answers

Guess a number, and in the attempts, through the percentage show tips

I'm trying to create a game where the user must determine a range and guess a random number that is generated within this range. When the user enters a number to try to guess, the program must respond with one of the following messages: Theco...
asked by 30.11.2015 / 21:02
1
answer

Using the lower triangularization method to calculate the determinant of a transposed matrix

Using the lower triangularisation method, I have to calculate the determinant of a transposed matrix. I want to calculate the determinant from the transposed matrix using the lower triangularization method, since the determinant has to be equ...
asked by 23.11.2015 / 00:36
2
answers

free (): invalid next size (fast) when trying to free memory

I have this struct in a data structure and need to free the memory it uses: typedef struct { int capacityOfElements; //capacidade do vetor int numberOfElements; //número de elementos presentes no vetor int *data;...
asked by 03.12.2015 / 02:43
0
answers

Compile-time symbols

When compiling only with -c and when viewing the symbols with $nm ficheiro.o , what does the C symbol mean and which section is assigned to it? I have read that it means that the symbol is common and that it is not started...
asked by 03.01.2018 / 15:27
0
answers

Christofides Algorithm - TSP, Problem in transforming AGM into a graph with all vertices of even degree

I'm implementing the Christofides algorithm and I'm getting the data from TSPLIB. the Christofides Algorithm has the following steps: Finding the Minimum Generation Tree Find all odd vertices (an even number of vertices) Find the perfect...
asked by 07.06.2018 / 17:25
0
answers

Interrupt per timer - PIC18F4550

Hello, I am a student of the Mechatronics Technician course. My teacher passed a project to show the speed of a DC motor with reduction, in RPM, in Hyper Terminal. He said we need to use the timer interrupt, however, I did not understand how to...
asked by 05.11.2017 / 00:02
2
answers

How to pass an integer file to a vector in C?

I have a problem when passing the data from my file (integers) to the vector. The purpose of the program below is to check the performance of sorting algorithms (Mergesort, Bubble Sort, QuickSort) but whenever I put a number of data above 42,...
asked by 23.10.2017 / 19:43
1
answer

Find and show the way - labyrinth in C

Well, someone can help me. I need to implement a recursive function that gets a labyrinth and a current position.    The maze is given by a char array where 'X' represents a wall, '0' represents a path, 'E' represents the input, and 'S' rep...
asked by 26.08.2018 / 00:40
1
answer

Delete a space allocated by malloc

First of all, I allocated 6 spaces of 52 bytes belonging to a struct in memory: lista = malloc(6 * sizeof(registro)); In practice to access them via pointer is done: lista[0], lista[1], lista[2]... And how would I delete content stored...
asked by 02.11.2016 / 17:16
1
answer

Show students' grade in C

I wanted to display the students note when I typed all the notes, in an array of 10 positions, I tried out of for, but it returns me only the last one. #include <stdio.h> #include <stdlib.h> int main() { int notas[10]; int...
asked by 16.05.2015 / 21:40