Go to Post Legend has it that Brandon installs the server in a bulletproof case shortly before Kickoff. That way, when the server explodes, the damage to surrounding things is minimal. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 28-02-2011, 23:18
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Re: help with file I/O on Crio ... unable to read file when fopen fails

Quote:
Originally Posted by byteit101 View Post
slightly off topic, but why are you using C style IO when C++ IO is available? In 09 we successfully used fstream IO with just "file.ext" style and "existingdir/file.ext" style open args
Code:
fstream file;
file.open("test.txt");


if (!file.is_open())
{printf("failed to open"); return false;}

file>>floatTest;


//and later we have something similar in order to write using fprintf
file<<floatTest;
Both ways are perfectly okay, depends on preference. We (114) like to use C-style I/O because it seems easier to use (for us).

Also, don't forget to call fclose or file.close() function before you exit.
__________________

JabbaScript
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi