View Single Post
  #3   Spotlight this post!  
Unread 28-02-2011, 20:54
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: help with file I/O on Crio ... unable to read file when fopen fails

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;
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote