Questions tagged as 'c'

1
answer

Problem with storing and printing strings in C

I'm picking up words from a text file, and at the time of printing they're all right except when I store them in a vector. If I store them in a vector, at the time of printing, some random characters come out before the words. void leArquivo(F...
asked by 17.11.2018 / 18:13
1
answer

How do I remove the dot (.) from an array of characters?

I'm developing a program that reads a whole line, takes the last three values and replaces the comma by point, and then transforms this number to double. But I'm not able to develop a method if the number is, for example, 1**.**345,50 ....
asked by 11.11.2018 / 20:46
1
answer

Read from file txt to vector of char

I have a dados.txt file with (fictitious) CPFs in the following format: 382031758-71 647900189-01 460754503-73 696170135-72 And so on, with a total of 500 cpfs. I'm trying to read each one and put char cpf[12] (because each on...
asked by 04.10.2018 / 19:45
1
answer

Inline in an infinite recursive function

What happens to the program if I declare an infinite recursive function inline ?     
asked by 17.07.2018 / 01:54
1
answer

Comparison in "if" does not fall where it should [duplicate]

What error in my code? For regardless of the answer, the result is else . #include <stdio.h> int main () { //variaveis char sigla[3]; //programa printf ("Entre com a sigla do seu estado:"); scanf ("%s", &am...
asked by 24.07.2018 / 01:17
1
answer

Struct and matrix, how to relate?

I'm making a code for a college job and a question has arisen about how to assign values to an array of type struct . struct posicao { int x; int y; }; struct posicao inimigo_val[5][15] = { {{0,-1},{0,-1},{0,-1},{0,-1},{0,-1},{0,-1},{0,...
asked by 10.07.2018 / 19:13
1
answer

Use "-" or "." in a linked list?

Good afternoon, doing a hash table without collisions, I created the struct list, however when compiling the code it does not accept that I use the -> prox from my struct, it asks me to use .prox. But if prox is a pointer I should not use struct...
asked by 11.07.2018 / 20:42
1
answer

Problem in programming C - Vectors

The problem is:    Write an algorithm that reads 3 vectors A[1..10], B[1.10] e C[1..10]   and writes the elements that are in A and B (intersection) but are not   Write the values in the order they appear in vector A.   three vectors s...
asked by 10.07.2018 / 19:41
1
answer

Check if the number entered is already present in struc

Good afternoon, I'm facing the following problem. I need to make an algorithm for registering 15 people with the following information: account number, name and balance. However it is necessary to check if the account number has already been ent...
asked by 30.07.2018 / 17:30
1
answer

Use a variable to limit character reading with fscanf and data mask

I've created a structure that holds any three records. These records I read from a file f. They have a definite size, in the case below the first die has three characters, the second 17 and the third three. I use it because data can come in anyw...
asked by 13.10.2018 / 21:33