Questions tagged as 'c'

1
answer

How to use esc to stop a program in the middle of its execution in C?

I would like to stop the program by pressing ESC at any time, how could it be?     
asked by 14.12.2017 / 11:09
1
answer

Difference calling a function in DllMain by CreateThread or calling directly

What's the difference in calling a function in the following ways: The first way to create a thread. Example: DWORD WINAPI Metodo1(LPVOID) { // Meu código aqui... return NULL; } int WINAPI DllMain(HMODULE hModule, DWORD dwReaso...
asked by 04.10.2017 / 20:41
0
answers

How to solve memory leak problem in libxml2?

I am making an application, however I am having problems with memory leak when I use libxml2, I already removed all the code to isolate only the libxml2 and still I have the memory leak error when I use valgrind, how can I solve this problem ?...
asked by 22.02.2018 / 11:35
0
answers

Send unspecified amount of JSON strings via socket

I have a cliente/servidor application where the client makes a request to the server and it asks a banco de dados and then returns that data to the client in JSON format, as I do not know how many records I have in my I thou...
asked by 02.10.2017 / 14:35
1
answer

Infix function for postfix

I'm trying to make a code that makes a function get Ex: 4 + 2 for a postfix Ex: 42+, I can not get the priority of the elements, type, when I make the expression 4 + 2 * 8 the right and print 428 * +, but you're printing 42 * 8 +, because of the...
asked by 04.06.2017 / 18:10
0
answers

Generate random numbers in a floats vector in the C language [closed]

I would like to know how to generate a sequence of random numbers, ranging from 0 to 10, of the float type into a vector of size 10.     
asked by 28.06.2017 / 14:38
2
answers

How to use the "fread" function in c to read a txt file string and store that string in a vector?

Hello, I'm trying to read a block of bytes from a .txt file that contains a string. For example, I want to store this string in a vector of char. #include <stdio.h> #include <stdlib.h> #include <string.h> char nome_arq...
asked by 11.06.2017 / 20:09
1
answer

Calculate diagonals of an array using Threads

I need huge help. I need to do a C program in which I compute the diagonals of an array using Threads as per the statements: AsIwastold,Ishouldpassthevalueofthediagonalandthejump(diagonalchange)asparameters,butIdonotknowwhattodowiththosevalu...
asked by 09.06.2017 / 21:26
1
answer

How to look for an element in a vector of structures?

Good evening! I am doing a job in 'C' where I have to look for doctors by specialty, that is, I ask the user the name of the specialty to look for and I make a'printf 'of the doctors of that specialty. I tried to do this but always gives me "Eni...
asked by 22.08.2017 / 00:00
1
answer

How to create a vector by joining among others 2

I'm doing an exercise with vectors where I need to read two vectors of 5 positions each, and after that, concatenate these two in a 3 of 10 positions. My program is printing the first vector correctly, but in the second it prints 4, 5, 5, 268...
asked by 20.08.2017 / 20:40