Questions tagged as 'c'

1
answer

How to store value entered by the user in 2 different arrays?

Well, this code is part of attempting to resolve an exercise. My goal is to convert all Kelvin values to Celcius or vice versa and display all values entered by the user whether they are temperature values in Celcius or Kelvin. For this I have a...
asked by 21.12.2018 / 16:00
1
answer

Malloc in a string, based on the size of a FILE

int main(void) { FILE *p = fopen("matriz.txt","r+"); char *arquivo; arquivo=(char*)malloc(sizeof(p+1)*sizeof(char)); while (fgets(arquivo,sizeof(arquivo),p)) { printf(" %s",arquivo ); } }//END the matrix cont...
asked by 13.12.2018 / 14:53
0
answers

Help in a C project

I'm doing a project for programming but I'm not able to do the extreme command or command county, I leave here the project page . I created 4 auxiliary functions similar to this one, in which the only difference is in latitudes, longitudes a...
asked by 12.12.2018 / 23:32
1
answer

How to read a file and insert data in c

Hello, I'm new to C and I have the following doubt I have a program that needs to save and read student data. Sample student below: typedef struct academico{ char nome[50]; char cidade[30]; char estado[20]; char rga[...
asked by 08.12.2018 / 03:11
3
answers

Error reading all the records of a .txt file in C

Can anyone tell me why this my code just returns the first record multiple times, instead of returning all the records? Function in the Code void listarDados(int quantidadeContatos) { char caracteres; FILE *arquivo = fopen("contat...
asked by 16.12.2018 / 18:09
2
answers

Help function fread library C

Can anyone tell me why this snippet of code just starts reading from the second element of the file? And how could I do to read all the records in the file? Code that I'm trying to use to read a txt file fread(vPtrContato, sizeof(cont...
asked by 16.12.2018 / 16:28
3
answers

Use of increments in C

What is the difference in the use of increments in language C, considering an integer N? N++ ++N N-- --N     
asked by 22.02.2016 / 23:34
1
answer

How do I show quicksort randomized step by step?

How do I show the ordering process step by step? Whether showing the state of the vector at each exchange or showing a tree. I tried to print each of the three functions and also tried to create a function, but the results only got worse. #inc...
asked by 03.12.2018 / 21:28
0
answers

How do I get the vector with the smallest "me", and copy it to another vector that the case calls "mnr"

Note: I did not start the code because it does not influence! I'm trying to pass the coordinates of the array that has the smallest number of zeros in your column, row, or quadrant (to make a sudoku solver). Thanks so much! int main()...
asked by 04.12.2018 / 02:18
1
answer

Compare date and time

In C I have the time.h lib to manipulate date and time, already in Arduino the DateTime class that implements some methods. I'm not finding, even if it's in the fingernail, how to compare date and time, for example: if ( dt >= checkin )...
asked by 07.12.2018 / 01:35