Questions tagged as 'c'

1
answer

Error Stack smashing detected in C

Could anyone help me with the following question: Construct a program that fills a 6x4 array with integers, computes and shows how many elements in that array are greater than 30, and then assemble a second array with elements other than 30....
asked by 07.06.2018 / 22:26
1
answer

Problem creating minimax in chess game

I am coding a chess set only in pure C. The game itself is done, I've been trying to develop the minimax algorithm for some time. Currently the algorithm is almost ready, but it is not yet returning and I think the problem lies in the minimax fu...
asked by 22.05.2018 / 04:22
1
answer

The system is not reading the requested line

I made the code below to read simple date information, but when it reads the day, it oddly asks for two entries, and ends up going one for the variable diatemp and the other for the diatemp > mestemp , without calling printf ("Type the month...
asked by 17.05.2018 / 02:36
1
answer

Problems with CRUD using MySQL

I'm trying to create a simple CRUD, but I'm having problems with the query method. I wanted the method to display the following: Name, enrollment, course, phone and email in the first row and below the tuples information one by one in an orga...
asked by 18.06.2018 / 02:40
1
answer

I need explanation because the code in C gives a Segmentation fault error

I started my dynamic allocation studies but I can not make a simple example, I could not find the problem. #include <stdio.h> #include <stdlib.h> #define SUCESSO 1 #define FALHA -1 typedef struct { int x; int y; } Ponto;...
asked by 16.06.2018 / 20:35
1
answer

Wrong Output in C

I'm doing an activity and the result is giving values that I do not assign anywhere in the code. int main(){ int numeroDePessoas = 0, tarefa = 0; scanf("%d %d", &tarefa, &numeroDePessoas); float passageiros[numeroDePessoas][5]; for...
asked by 23.04.2018 / 02:10
2
answers

How do I go through a list chained from the last position?

I have a question about the list chained in C. The exercise is a function that receives as a parameter the initial node of the linked list and the position x (counting backwards). With this, I have to go through and find the position, return the...
asked by 18.04.2018 / 15:38
1
answer

Difficulty in accessing elements in a vector C

In the code below I try to get the largest element of a vector. However when I try to access the vector elements I can only access the index 0 and consequently I can not access the other vector elements. Below is the source code ( main.c ):...
asked by 11.06.2018 / 02:10
1
answer

How to transform a number from decimal to binary using String

Well I managed using integers, but the teacher wants to accept code that is too large that does not fit in the integer, it said it had to read as a string, but I do not know how this can be done. > My code using integers #include <stdio.h...
asked by 29.04.2018 / 15:52
2
answers

Calculation of distance in C

The question asks to calculate the smallest distance between cities. The geographical coordinate of each region was given. The correct output would be: 1646.3 189.9 My output was incorrect in the second calculation: 1646.3 181.1 URI...
asked by 18.05.2018 / 16:48