how to open file using c program?
parth2911 0 Newbie Poster
Recommended Answers
Jump to PostUse fopen
Jump to PostIn order to know if it worked or not you have to test the return value of fopen()
#include<stdio.h> int main() { FILE *fp; fp=fopen("c:\\1.txt","r+"); if( fp == NULL) printf("file not found\n"); else printf("Success!\n"); fclose(fp); return 0; }
Jump to PostYou asked the wrong question at the beginning of this thread. Why didn't you say that in the first place, we can't read your mind. You need to use this function to launch …
All 9 Replies
nitin1 15 Master Poster
Banfa 597 Posting Pro Featured Poster
parth2911 0 Newbie Poster
Banfa 597 Posting Pro Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
parth2911 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
parth2911 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.