OnlineGDB Specific
The easiest you can achieve something like this via OnlineGDB is to select "Text" instead of "Interactive Console" at the bottom of the editor, so you can provide the input as a text (file).
A more sophisticated way would be to create a proper project in OnlineGDB and add a new file to it ("New File" icon left to the RUN button).
I've made a quick project sample for you: https://onlinegdb.com/NLIY0TgfC
#include <stdio.h>
int main()
{
FILE * file = fopen("input.txt", "r");
char line[255];
fgets(line, sizeof(line), file);
printf("Line read: %s\n", line);
fclose(file);
return 0;
}
Read/Write Access
So what you need are:
- A file to be read by your program (a.k.a. input file)
- Owner can edit the input file
- User can not edit the input file
If your program doesn't need to change this file, just read from it, then it's simple. You just have to enable read access on these input files for everyone else, while only the owner would have write access (either Linux or Windows or Mac, etc)
You can read how to use the chmod command here.
Also you need a delivery system to distribute the file to the user.