Open files.......but how?

Non-platform specific questions.

Open files.......but how?

Postby savvy » Tue Jun 16, 2009 7:36 am

can anyone tell me how to make it so that when you click on something, it opens a file?

if it is the fopen, then which options do i choose!
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Open files.......but how?

Postby skydereign » Tue Jun 16, 2009 7:44 pm

It depends on what file you want to open... kind of. For the most part I would say fopen.

fopen will open a named file and return a stream. If there is no named file, or another error occurs, it returns NULL. To be able to do things within a file, you should create a FILE*.

Code: Select all
FILE * fopen(const char * filename, const char * mode);

The file name is the complete name of the file... The mode can be;
"r" opens text file for reading
"w" creates text file for writing, it will discard the previous contents
"a" I think this is apend, which if I am not mistaken opens or creates text file, but you start at the end of the file
"r+" I think this is just update reading, though there are more rules to this, so I don't suggest it.
"w+" Again for update, don't suggest.
"a+" Same as a but update...
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest