Questions tagged as 'arquivo'

1
answer

how to receive input from the user and write to a file

I am trying to receive several lines of input from the user (at most 37 chars each) and write them in a file, but the result is the creation of the file with nothing there. My current code: void escrever_para_ficheiro(FILE *fp){ char bu...
asked by 02.06.2018 / 02:55
2
answers

How to open file separating each line in an item from a list / tuple?

In PHP, we have a function called file which, when opening a file, causes each line to be placed in an item of a array . Example: hello.txt olá mundo php script file('hello.txt'); // array('olá', 'mundo') I...
asked by 23.03.2017 / 17:51
1
answer

Binary file being written incorrectly

Creating the binary file: #include <stdio.h> int main(int argc, char const *argv[]) { FILE *BIN; BIN = fopen ("BIN.bin","wb"); if (BIN!=NULL) { for (int i = 1; i <= 100; i++) { fwrite( & i,sizeof(i),1,BIN);...
asked by 21.11.2018 / 13:39
2
answers

Problems with fwrite in binary file

I'm trying to write and read an integer in a binary file with the following code: #include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct{ int free_slot; }header; void main(void){ FILE *fd = fopen("te...
asked by 30.10.2017 / 17:06
2
answers

Algorithm with flowchart / diagram

Well, I'm taking a course in logic and the following question fell:    Develop a block diagram to check which products need to be purchased and the quantity to be purchased: Having the following information:       Product code (CODPRO), Mi...
asked by 09.12.2017 / 00:31
1
answer

Scanner is not picking up all lines

I have a file with 7 million lines, but my code takes a maximum of 63000 and does not return any error. Scanner sc2 = null; try { sc2 = new Scanner(new File("./assets/words.txt")); } catch (FileNotFoundException e) { e....
asked by 27.07.2017 / 20:06
1
answer

Protect Excel worksheet in C #

In a C # application, it can take from 1 to 2100 hours of data gathering. The data is saved in a CSV Excel spreadsheet every minute. With the code below we can hide and show the file. #region string diret=saveFileDialog1.FileName;...
asked by 13.07.2017 / 11:09
3
answers

More attributes in AppSettings

Is it possible to add other values to AppSettings without breaking with the application? Default values: <appSettings> <add key="Nome" value="ValorTeste" /> </appSettings> I would like to leave it like this...
asked by 03.05.2017 / 19:30
1
answer

How to read text files and put the words in a vector?

I need to make a code that reads a text file (txt) and save only the words in the positions of a vetor , below my code follows: int main(int argc, char** argv) { FILE *file; file = fopen("arquivo.txt", "r"); char x[100];...
asked by 16.01.2016 / 16:27
2
answers