Re: Reading Text Files
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Fri, 06 Mar 2009 08:37:05 +0000
Rafael said:
Barry Schwarz escreveu:
On Tue, 03 Mar 2009 18:44:08 +0000, Flash GordonCopy teh document to the root directory (c:\) and give it a try.
<smap@xxxxxxxxxxxxxxxxx> wrote:
Barry Schwarz wrote:
On Mon, 2 Mar 2009 20:49:20 -0000, "Mike" <gdf@xxxxxxx> wrote:What mandatory diagnostic? In C90 those are all just simple
Hi,Did not your compiler generate some mandatory diagnostics on
I'm trying to create a C function that will read a text file
but I keep getting fopen() = NULL
I've tried my own code and when that didn't work I tried code
off various websites and they keep giving the same result.
The file was created in notepad, saved as a .txt and contains
only "abcd" without quotes.
Only thing I can think of is that the program doesn't have
rights to access the file....possibly because it's Vista? But
nothing turns up after searching.
The code is written:
FILE *fp;
fp = fopen( "C:\Users\<Username>\Documents\R.txt", "r" );
this line?
escape sequences invoking undefined behaviour. If gcc is right
then \U has special meaning in C99, but there is every chance
the OP is not using C99.
I was thinking of the one required by footnote 65 in n1256 but I
see that it is not required in C89.
That wouldn't fix his problem, which is that he's forgotten to
escape his backslashes.
By the way, what compiler are you using (I dont have your original
post, sorry).
It doesn't matter - the code is equally broken in all C compilers,
because backslashes are escape characters in ISO C.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: Reading Text Files
- From: Rafael
- Re: Reading Text Files
- References:
- Reading Text Files
- From: Mike
- Re: Reading Text Files
- From: Barry Schwarz
- Re: Reading Text Files
- From: Flash Gordon
- Re: Reading Text Files
- From: Barry Schwarz
- Re: Reading Text Files
- From: Rafael
- Reading Text Files
- Prev by Date: Re: about c
- Next by Date: Re: floating-point literal cannot appear in a constant-expression
- Previous by thread: Re: Reading Text Files
- Next by thread: Re: Reading Text Files
- Index(es):
Relevant Pages
|