Advertisement

I/O Newbie

Started by April 05, 2002 07:18 PM
25 comments, last by XtremeIdentity 22 years, 7 months ago
quote: Original post by GoofProg
Do you think C is a crap language.. that hurts =)
Remember that C++ is only C +1.
i didnt mean that C sucks, just its standard libraries
quote: Original post by GoofProg
You can. A pointer will be allocated and will point to something or it''s a NULL value

A pointer will *not* be allocated, and an object *cannot* be NULL. The reason the previous code works is that streams define an implicit conversion to bool which gets invoked when performing a boolean check on the stream''s state.
Advertisement
Hopefully, the newbie gained from all this that all that should be in the dat file should be 60. Nothing else.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions ]
Thanks to Kylotan for the idea!
Well let''s say, i had multiple variables that needed to access the dat file. Is there some special label you could put on the info of the dat file, so this one variable can take THAT specific data out of the middle of the dat file somewhere?

--------------------------
->Take it to the Xtreme!<-
--------------------------
--------------------------->Take it to the Xtreme!<---------------------------
In that case, your best bet is to use an .ini file and the Windows [Get/Write]PrivateProfile[String/Int] family of functions.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions ]
Thanks to Kylotan for the idea!
I think that''s way over my head.

--------------------------
->Take it to the Xtreme!<-
--------------------------
--------------------------->Take it to the Xtreme!<---------------------------
Advertisement
Just put the values in a particular order in the file, and read them in that order.
Yes, but you can''t just take one variable and take a piece of data out of the middle of nowhere in your .dat file...

--------------------------
->Take it to the Xtreme!<-
--------------------------
--------------------------->Take it to the Xtreme!<---------------------------
No. File I/O is sequential. Get over it.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions ]
Thanks to Kylotan for the idea!
*Sigh* Ok thanks.

--------------------------
->Take it to the Xtreme!<-
--------------------------
--------------------------->Take it to the Xtreme!<---------------------------

This topic is closed to new replies.

Advertisement