First and foremost, you MUST absolutely check your file to make sure that it opened. so, if((file_in = fopen(name, "r")) == NULL) { printf("File could not be opened"); exit(1) }
because if you don't check that and you try to open a file that does not exist it will give you segmentation faults, and obviously you have no idea what is, but it is thought to be an unrecoverable error.
*EDIT* ALSO, NEVER EVER use magic numbers (char name[50] and char text[10000]) What a waste of space... what if you only read 3 characters, thats 9997 bits of memory that could've been used for something more useful. What you should do, although you don't even need those arrays for this, is use define. (i.e. #define MAXNAME 50 or #define MAXTEXT 100) When you use define, there is no semicolon at the end of the line.
Now, for your future coding if you want to allocate a text array of 10000 characters, don't do that. Allocate the memory as you go. In order to do so, you need to learn malloc and realloc.
I will give you the gist of malloc and realloc.
malloc is the initial allocation of memory, so generally what I do is allocate, initially, 80 bits. So I would have my #define MAXLEN 80, then if ((int x = (int *) malloc(MAXLEN * sizeof(int))) == NULL) {
printf("Allocation failed.\n"); exit(1);
} Because if your system is unable to allocate 80 bits of memory, it is another one of those unrecoverable errors. But that is the initial allocation. SO if that passes you now have your 80 bits, allocated. Next I would run a check to make sure I wasn't at the end of the file, and then if I reached the end of my allocated memory and I haven't reach EOF I would realloc 80 more bits of memory.
next, you can use 2 methods, either strtok, which I would not suggest for you. Rather, use getc.
Keep in mind getc returns the ascii code of whatever letter it reads, in other words, its return value is an integer.
So, I will not give you the code for the getc function, you should research it a little bit, get to know the function. However, I will give you this... run the getc through a while loop saying while(getc != EOF) *that is not the actual code, but its pretty close to it.* Its pretty simple, shouldn't be tough for you to get.
then, to print it is simple just a printf statement that prints each character on its own. I forget whether or not you need %d or %c, but should be simple. Keep in mind, getc will also get the '\n' character so you don't need to worry about that.