C Programming - Input / Output - Discussion

Discussion Forum : Input / Output - General Questions (Q.No. 3)
3.
What does fp point to in the program ?
#include<stdio.h>

int main()
{
    FILE *fp;
    fp=fopen("trial", "r");
    return 0;
}
The first character in the file
A structure which contains a char pointer which points to the first character of a file.
The name of the file.
The last character in the file.
Answer: Option
Explanation:

The fp is a structure which contains a char pointer which points to the first character of a file.

Discussion:
8 comments Page 1 of 1.

Hariom Dhangar said:   5 years ago
What is fopen?
(1)

Hanuma8182 said:   7 years ago
Trial is a filename and 'r' refers to read mode.

fp is the pointer of type FILE (datastructure).
fp has a reference of file and points from the first character of the file "trial".

Vishu said:   8 years ago
@Himanshu.

fopen("trial","r") ---> here 'trial' is the name of the file and you open that file and reading the content of the file. That's all.

Madhu said:   10 years ago
@Himanshu.

Trail-name of the file.

R-reason of it's opening (read, write,...).

Varsha said:   1 decade ago
Why we use f or why we write printf?

What doesn't mean?

Himanshu said:   1 decade ago
But what does are of fopen ("trial", "r") mean?

Royal said:   1 decade ago
FILE is a structure, can any one give me the FILE structure members?

Kushbu said:   1 decade ago
The fp is a structure which contains a char pointer which points to the first character of a file.

Post your comments here:

Your comments will be displayed after verification.