Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how we can upload our data from disk to c programming

–4 votes
asked Jan 24, 2020 by anonymous
How we can upload data from disk to c programming

2 Answers

0 votes
answered Feb 6, 2020 by Nando Abreu (930 points)

You tagged Python, please correct.

0 votes
answered Feb 14, 2020 by anonymous
Read from files that have a file pointer to a buffer stream within C to able to access. Can also write/append back to disk.

Some functions for reading that can be used are fgets, fgetc, feof and fread.

Modes to read for normal txt files = r, r+, w+ and a+. If the file is a binary file (.bin), use rb, rb+, wb+ and ab+

Have to open a file to be able to read etc. When changing modes, need to close then reopen. Remember to close the file pointer after use.

#include <stdio.h>

void main(){

FILE *pointername;

pointername = fopen("name and possibly path if required with mount point", "mode");

Read etc.

fclose(pointername);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...