Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. File Processing
  5. File Processing Operation...
  6. File Open

File Open

  • A file can be opened using built – in fopen( ) function
  • It is present in stdio.h library file of C
  • The file should be exist in the same directory as C program files else full path name has to be specified as file name
  • The fopen() function takes two parameters; filename and mode

Syntax

fopen
FILE *fopen(const char *filename, const char *mode)

Parameters

filename âˆ’ This is the C string containing the name of the file to be opened.

mode âˆ’ This is the C string containing a file access mode.

Return Value

This function returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

Access mode

Views: 0

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments