Questions tagged as 'c'

0
answers

Write to information file in C

So, folks, I'm doing a job that essentially consists of recording information about movies and series in two files (one for each one). In the code section movies.c I have all the functions used to manipulate information about movies (which...
asked by 30.06.2017 / 01:44
1
answer

Print item from a queue by removing each item from it

I'm doing a program that receives a string with comma-separated words that separates those words and lines them (so far I've been able to do it quietly), then the program has to remove and print the items, but I can not develop the de-working fu...
asked by 10.07.2017 / 05:32
1
answer

udp server does not receive the udp linux client message

Well, I was programming a simple messaging system, when I tried the same computer, it worked correctly without any problems, but when I tested on two different computers, the server did not receive the message from the client I created, help me?...
asked by 26.06.2017 / 06:55
0
answers

Regarding Bit-Bit Operators in a sum operation

Hello, I have this part of the program and I would like to know why these assignments should be used, and only prints the variable b int soma() { int a,b,c; printf("Digite o numero que deseja somar\n"); scanf("%d", &a);...
asked by 26.06.2017 / 06:05
0
answers

"no such file or directory" error - Eclipse

I'm developing a software on a prototype board, which is the ARMST32 - F411RE, so I created the following model in the STM32CubeMX software: ButwhengeneratingthealgorithmandtryingtoviewitinEclipsethefollowingerrorappearstomeNosuchfileordirec...
asked by 31.08.2017 / 18:34
1
answer

Get filenames and put char array

How do I get the names of the files in a directory and put them in a multidimensional char array? #include <stdio.h> #include <dirent.h> int main() { char arrayNomes[10][50]; char dirn[50]; DIR *dir = NULL; struct...
asked by 24.06.2017 / 21:11
1
answer

Change an array of char within a function

I'm trying to pass a char array pointer to a function. I want it to make changes to this char array. Here is the code for the function: void dhnfe( char tzd, char hverao, char *dh) { if (hverao == 1) { switdh(tzd) {...
asked by 24.06.2017 / 20:45
2
answers

Test for prime number [duplicate]

#include <stdio.h> #include <stdlib.h> #include <locale.h> int main(void){ setlocale(LC_CTYPE,""); int num; int divisor = 2; int primo = 1; // se primo = 1 é primo // se for primo = 0 não é primo print...
asked by 06.07.2017 / 15:04
1
answer

fprintf () C error when printing, displayed value (-1, # R) other than the one to be allocated (0)

I'm doing a program that basically takes a float, calculates a percentage under the value if you want to write, it will write the information in a txt to be incremented now (basically used as a database). The problem comes in the following aspec...
asked by 12.07.2017 / 02:10
1
answer

Copying the contents of a file to vectors in c

Folks, I'm trying to copy a file that has multiple products, one line with the name and the following with the code, price, and quantity. I tried to pass each line to a vector, but it is not working. When I print, it is not correct. fp = fope...
asked by 23.06.2017 / 14:51