![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
fopen
Can anyone tell wat does this do?? -
_FOpen(Time_File,"r",fp_time); _Fread(&st_Time,sizeof(TimeHead),1,fp_time,TimeFile); Thankx jazz |
|
|
|
|
|
#2 |
|
Programmer
|
I can't tell you(cus i don't know), but why not google for some c tutorials while waiting and see if not one of those covers it..
-thondal-
__________________
"die" he screamed at the polygon man. When he was done with him, only four points remained, a quad of what he once was. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
In C tutorials i have seen- in fopen there are only two parameters passed. But in the above there are 3 paramenters, is it that-
1)fp_time is read into Time_file?? 2)then in fread why are fp_time and Time_File both parameters passed?? Can u please explain, i could'nt understand that. thankx jazz |
|
|
|
|
|
#4 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 579
Rep Power: 5
![]() |
I can't find either of those on google...maybe its because they're preceded by an underscore, but _FOpen(Time_File,"r",fp_time); looks like
freopen(const char *path, const char *mode, FILE *stream) _Fread(&st_Time,sizeof(TimeHead),1,fp_time,TimeFile); Looks like the standard fread(void *ptr, size_t size, size_t memb, FILE *stream)
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
#5 |
|
Newbie
Join Date: May 2006
Posts: 18
Rep Power: 0
![]() |
does it mean that it is opening and reading 2 files at a time??
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5
![]() |
Neither _FOpen() and _FRead() are standard C functions. They are probably vendor specific extensions or (as Benoit has suggested) wrappers for freopen() and fread(). freopen() is used to open a file in place of an existing open stream; it typically does this by closing the open stream (not by opening two files at once).
|
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
They can also be macros for fopen and fread.
And the C99 standard for freopen is to return a stream identifier, having tried to close the existing one first, with the new one aimed at another file. Think of it as associating an already open stream to another file. The most common use being redirection of stdin, stdout, stderr. |
|
|
|
|
|
#8 |
|
Programmer
|
FOPEN is C++
__________________
Get programming and game creation tutorials and discuss apon you peers at http://s14.invisionfree.com/tsoft We also accept custom software requests and new mods will be needed soon |
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Excuse me??
Please try to avoid misleading people.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
You might be thinking of ifstream and ofstream, which are C++ specific. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling Maverik 6.2 (from C) | megamind5005 | C | 16 | May 3rd, 2006 6:41 PM |
| Can't open .REG files with fopen. | Stevo | C++ | 2 | Mar 24th, 2005 5:56 PM |