Questions tagged as 'c'

1
answer

BubbleSort - Lexicographic (Alphabetical Order) repeats the first name

I'm doing a name sorting exercise with BubbleSort, but when sorted, the first name repeats itself. Example: I register to register 5 people:    Ana   Luiza   Gabriel   Ester   Luciana And the ordering comes out as follows:    Ana...
asked by 02.12.2018 / 22:20
1
answer

Copying Files using System Calls

I'm having trouble using the write (), read (), close (), open () functions to copy a text file to a new (previously created) file. After some research I did get the following code: #include <fcntl.h> int main(int argc, char * argv[])...
asked by 25.10.2018 / 19:29
1
answer

What is the solution to this comparison? [closed]

I'm programming in C for a college subject, we read a file and create some list methods to use in the program, basically I implement the structure of a list and use in a solution for a requested program. My problem is that, my code works and is...
asked by 28.10.2018 / 02:08
1
answer

Error Segmentation fault (core dumped) Double circular list

I've been trying to make a Double Circular List for hours. I have tried to correct all the errors but it gave a error 'Segmentation fault (core dumped)' that I have no idea what it is. Can anyone help me please? Below is my code: //Arquivo...
asked by 17.10.2018 / 06:45
1
answer

Queuing function in C

I've created the following queue: typedef struct No { int pos; char cpf[12]; char nome[40]; struct No *prox; } No; typedef struct No * p_no; typedef struct{ p_no ini, fim; } Fila; typedef Fila * p_fila; And I have the f...
asked by 18.10.2018 / 19:29
1
answer

how to play letter by letter of a sentence in an array?

Example: In the phrase naruto , the letter n of the frase vector is in the frase[0] position. I want to put it in mat_cript position [0][0] . Not just her, the rest of the sentence too. #include <s...
asked by 16.11.2018 / 17:05
1
answer

Convert structure to string

How can I convert an integer to string? Example: convert int cod to char cod[30] . #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> #include <windows.h> struct Tipo_Lis...
asked by 04.11.2018 / 17:26
2
answers

When inserting into a vector always overlays the previously entered value

In my code when adding a contact (X), and seeing the list of contacts, I have contact X, but when adding another contact (Y), and go to see the list, contact Y replaces X, how can I to add multiple in the vector? #include <stdlib.h> #inc...
asked by 04.11.2018 / 23:31
1
answer

Change from binary base to decimal base

I've been trying to program a code to solve an exercise. Here's the question: Write a program in language C that reads a string of any size containing binary digits and prints the corresponding decimal value on the screen. The input readin...
asked by 29.11.2018 / 21:52
1
answer

How to allocate space for each structure of a vector as the user wishes?

Well, how do I allocate a structure whenever the user wants to allocate another one? How would I make this increase? I'm putting a code here just so you can understand my problem. #include <stdio.h> #include <stdlib.h> /* SÍNTESE...
asked by 04.10.2018 / 23:35