Questions tagged as 'c'

1
answer

Problems sorting code with ShellSort

#include <stdio.h> typedef struct { int id_submissao; int tempo; int id_equipe; int id_problema; char status; } Linha; void shellSort(Linha *v, int n) { int i = (n - 1) / 2; int chave, k, aux; while(i != 0) { do { chave...
asked by 14.05.2018 / 00:39
0
answers

When entering values that give the same key, program the run-time error. Linked list problem

Runtime Error When you enter the enrollment values into which they are converted into keys for a hash-table . The values that conflict and fall into the same key. They are rescued in nodes for a Chained List . Repeated enrollment is not a...
asked by 14.05.2018 / 03:28
1
answer

Listing by name in a struct

Good afternoon. I'm in trouble with a job I'm doing. The work consists of: creating a student registration system, where the user records the student's name and record. During the listing of the data, the names must be sorted in alphabetical ord...
asked by 13.05.2018 / 21:23
2
answers

Function ends before asking for scanf value

Can anyone understand why, when in the acceptAllers function I call main (), main () does not execute the scan? That is, when I call again, main will not let me choose any options and will close the program soon. Thanks void main(){ int j=0;...
asked by 19.05.2018 / 19:46
0
answers

How to read PDF files using C language?

I have to read a PDF file using linguagem C and fetch a string from the file. However, when you drag the file through the fopen function and display it on the screen, all those characters appear in the same way when you open...
asked by 11.05.2018 / 03:06
0
answers

Doubt when passing information from one struct to another

I have created a system for studies, something very simple just to take a doubt, that I am already at a time. The following code is from a vehicle lease system (Since the focus is purely didactic and for the code not to get so large I've tried t...
asked by 21.05.2018 / 22:38
0
answers

How to solve overflow in this question?

I'm asking the question Star Trek I tried to put long long int but the problem still continues the number and 10 ^ 6, how to solve this My code #include <stdio.h> #include <stdlib.h> int main(int argc, char** argv) { long lo...
asked by 14.05.2018 / 16:40
1
answer

Segmentation Fault

I would like to allocate memory dynamically without informing how many elements a vector would have. #include <stdio.h> #include <stdlib.h> int cardinalidade(char *conjunto) { int contador = 0, indice = 0; while (1) {...
asked by 21.05.2018 / 01:10
0
answers

C - Stack Smashing Detected - How to correctly initialize a graph by adjacency list and insert edges?

I am getting sporadically and without making any changes to the code or entry, an error called Stack Smashing Detected. The only thing I'm doing is initializing a graph and inserting an edge in that, follow the code below: typedef int TipoPeso...
asked by 08.05.2018 / 18:30
0
answers

Infix to Postfix conversion - C-STACK

Code that should receive an arithmetic expression in infix (common) notation for postfix notation (Polish reverse). For example, when receiving (A + B C) it should print ABC +. The problem with my code is that when it receives "(A + B C)" it...
asked by 02.05.2018 / 05:13