file-pointer

difference between file descriptor and file pointer

Hi all, I want to know the difference between the file descriptor and file pointer.And also which is efficient in scenarios. ...

How to find the current line position of file pointer in C?

How can I get the current line position of the file pointer? ...

ftell on a file descriptor?

Is there a way to do what ftell() does (return the current position in the file) on a raw file descriptor instead of a FILE*? I think there ought to be, since you can seek on a raw file descriptor using lseek(). I know I could use fdopen() to create a FILE* corresponding to the file descriptor, but I'd rather not do that. ...

Opening a file in 'a+ 'mode

If a file is opened using the following command: FILE *f1=fopen("test.dat","a+"); The man page reads: a+ Open for reading and appending (writing at end of file). The file is created if it does not exist. The initial file position for reading is at the beginning of the file, but...

Passing file pointer into functions, and file not being read correctly.

I think my problem with my code that the file is not being passed correctly. The input is a file with three lines 1 2 3; 4 5 6; 7 8 9; and the output is a Segmentation fault (core dumped), the output is supposed to print the first line 1 2 3. #include <stdio.h> #include <stdlib.h> int getNum(); int getLine(); int getMatrix(); int det1(...