im trying to make a program that caputures the contents on a binary file (file.dat) and then asign all chracters to an array, then pass them through another function to output each charatcter
the problem that i am having is that when i output the chracters i dont get any
of the charachters on the file i recive just wierd icons or a letter (F) what im using to output
puts(buffer[0]); or puts(buffer[0]) or putc(buffer[0], fp)
is it possible to pass the array with all the file contents to another function?
here is the code example:
Code:void getWord(char* buffer) { int c, i = 0; while ((c = fgetc(fp)) != EOF) if (isalpha(c) || ispunct(c)) buffer[i++] = c; else { buffer[i] = '\0'; return; } buffer[i] = '\0'; Print (wbuf); /// Call Function Print } void output (wbuf []) { puts(wbuf[0]); }