This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: reading/writing to files
- To: "gnu-win32 at cygnus dot com" <gnu-win32 at cygnus dot com>
- Subject: RE: reading/writing to files
- From: Frank Smith <fsmith at jadestone dot com>
- Date: Tue, 14 Jul 1998 15:43:57 -0700
I don't know anything about cygwin and you may be using C, but I've had
problems with core dumps resulting from using C++ style strings with
C-style functions (C++ strings may not be null terminated depending upon
the implementation). If you must use a C++ string with a C-style function,
probably best to convert it to a C-style string first (e.g..,
xxxx.c_str()).
Frank
----------
From: Jonathan George
Sent: Saturday, July 11, 1998 8:31 AM
To: gnu-win32@cygnus.com
Subject: reading/writing to files
Hello all,
I'm writing this message again since my first message apparently didn't go
through....
I'm running Cygwin b19.1, compiling the program using: gcc -o lite lite.c
This program contains a routing that reads from a file then stores the data
that it read into variables, using fgets. When running this program, the
program "dumps core" everytime, yet if I do NOT call that function, then it
goes ahead and runs... It seems like whenever I try and access the
fprintf, fgets, or any file writing/reading function it will cause my
program to core. I'm pretty sure I have all the include's correct, and the
program itself compiles with no errors.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".