Questions tagged as 'c'

0
answers

How to read data from a .txt file

Hello, I am developing a queue of banks in C. How can I read entries in a file and thus assign values to some specific variable in my program? Example: I have a int qtd_boxes variable in main. I need to assign this variable a value read in a...
asked by 18.11.2018 / 15:41
1
answer

doubts in array

My program needs to get two vectors, A and B. This defines the set    A pikachu B as the set formed by the elements that appear in A or B. It also has the set    A chikorita B As the set consisting of the elements that appe...
asked by 12.11.2018 / 19:38
0
answers

prime random numbers in C

I have to make a program that can automatically and randomly generate 100 positive integers between 0 and 1000 and display in the console the sum and average of the primes in the created set. My code is like this and when I want to show a pri...
asked by 13.11.2018 / 12:32
0
answers

Compiler does not detect signal functions

Good evening! I study computer engineering and recently I have programmed in C because of a project ... This same project uses two libraries (#include signal.h, #include signal.h). We use a server where all students program and use a program...
asked by 19.11.2018 / 23:54
1
answer

Problem in displaying MATRIX in C

Hello, I would like help with trying to solve the problem of an array of my program in C. It was created the matrix saying that it should be filled with such a character, it even works, but the last line always does not display the character that...
asked by 09.11.2018 / 22:03
0
answers

How does a Merge sort work exactly?

I already know that it uses recursion and that it orders the vectors until they are ordered, however, it is exactly in this part that generates my doubts. How do I know when it will call the Merge method? When will he leave the first merge and e...
asked by 19.11.2018 / 00:16
1
answer

Does not enter the function and gives segmentation fault

Hello, please consider the structure and functions given below and the types defined. In the main function, when it enters the odd even function of the segmentation fault error. I'm not understanding why. Could someone help me, please? #in...
asked by 07.11.2018 / 23:58
0
answers

Saving the data in an array skips the next question

I have the following code: #include <stdio.h> #include <stdlib.h> #include <locale.h> struct cadastro_palestra { char nome[50]; char cpf[13]; char email[70]; }; int main () { setlocale(LC_ALL, "Portuguese");...
asked by 08.11.2018 / 11:39
1
answer

Create client-server model c / c ++ with two clients

I need to create a connection between 2 clients and 1 server using sockets in the linux and c ++ operating system. The problem I am facing is that I can not sync the messages and the server always ends up crashing at some point. I am new to netw...
asked by 08.11.2018 / 00:21
4
answers

Buffer Cleanup after getchar

Good morning, I wanted to know how I can optimize buffer cleaning when using the getchar () function, as an example follow the following codes: I get the following code from the correct output using the "scanf spacing" technique as shown:...
asked by 11.12.2014 / 18:03