Hey, I'm having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn't erase the last thing? 13 1237 Ha*******@gmail.com wrote:
Hey, I'm having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn't erase the last thing?
Learn how to use your editor?
--
Ian Collins.
On Feb 28, 8:42 pm, HardHa...@gmail.com wrote:
Hey, I'm having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn't erase the last thing?
Sorry for double post, but does anyone have any good C++ tutorials
besides the one at cplusplus.com?
On Feb 28, 8:43 pm, Ian Collins <ian-n...@hotmail.comwrote:
HardHa...@gmail.com wrote:
Hey, I'm having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn't erase the last thing?
Learn how to use your editor?
--
Ian Collins.
o.0
No, like this:
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
} Ha*******@gmail.com wrote:
On Feb 28, 8:43 pm, Ian Collins <ian-n...@hotmail.comwrote:
>>HardHa...@gmail.com wrote:
>>>Hey, I'm having a little problem editing a file. Whenever I put something into it, it erases the old thing, is there a way to fix this so it doesn't erase the last thing?
Learn how to use your editor?
*Please trim signatures*
>
o.0
No, like this:
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ofstream myfile;
myfile.open ("example.txt");
Look up the use of the second parameter of open, the mode flag. It
defaults to truncating the file.
--
Ian Collins.
Look up the use of the second parameter of open, the mode flag. It
defaults to truncating the file.
--
Ian Collins.
Thanks Ha*******@gmail.com wrote:
>>Look up the use of the second parameter of open, the mode flag. It defaults to truncating the file.
Thanks
Next time, *Please trim the signature* that's the bit after the "-- ".
If you use a news reader, it should do this by default.
--
Ian Collins.
On Feb 28, 8:55 pm, Ian Collins <ian-n...@hotmail.comwrote:
HardHa...@gmail.com wrote:
>Look up the use of the second parameter of open, the mode flag. It defaults to truncating the file.
Thanks
Next time, *Please trim the signature* that's the bit after the "-- ".
If you use a news reader, it should do this by default.
Okay, sorry
On Mar 1, 6:42 am, HardHa...@gmail.com wrote:
Hey, I'm having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn't erase the last thing?
hey you might have given this thing:
fopen("somefile name","w");
instead of w write "a" which means appending
in this way you wont lose the previous data...
Ian Collins wrote: Ha*******@gmail.com wrote:
Look up the use of the second parameter of open, the mode flag.
It defaults to truncating the file.
>
Thanks
Next time, *Please trim the signature* that's the bit after the "-- ".
If you use a news reader, it should do this by default.
He's using Google Groups, and that's not one of their features.
Brian
Default User <de***********@yahoo.comwrote:
Ian Collins wrote:
>Next time, *Please trim the signature* that's the bit after the "-- ". If you use a news reader, it should do this by default.
He's using Google Groups, and that's not one of their features.
Google Groups isn't a real newsreader ;)
--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Marcus Kwok wrote:
Default User <de***********@yahoo.comwrote:
Ian Collins wrote:
Next time, *Please trim the signature* that's the bit after the
"-- ". >If you use a news reader, it should do this by default.
He's using Google Groups, and that's not one of their features.
Google Groups isn't a real newsreader ;)
People got bent out of shape last time I said that, so I refrained from
commentary.
Brian
Default User <de***********@yahoo.comwrote:
Marcus Kwok wrote:
>Google Groups isn't a real newsreader ;)
People got bent out of shape last time I said that, so I refrained from
commentary.
Well, I added a winking smiley, so that should make it clearer that I
was kidding... but not really :)
--
Marcus Kwok
Replace 'invalid' with 'net' to reply
On Mar 1, 4:45 pm, "Default User" <defaultuse...@yahoo.comwrote:
Marcus Kwok wrote:
Default User <defaultuse...@yahoo.comwrote:
Ian Collins wrote:
>Next time, *Please trim the signature* that's the bit after the
"-- ". >If you use a news reader, it should do this by default.
He's using Google Groups, and that's not one of their features.
Google Groups isn't a real newsreader ;)
People got bent out of shape last time I said that, so I refrained from
commentary.
Brian
this is pertinent. I only could get back to usenet because of
googlegroups. I am sure there is a similar case for many good people
from here
many news servers disappeared or become paid :(
google sucks, but works (mostly)
Diego This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Matt |
last post by:
I'd like to overwrite just one line of a binary file, based on a
position set by seek(). Is there no way to do this? As far as I can
tell I need to read the whole file, change the line, and write...
|
by: Christo |
last post by:
borland c++ 5.01
character constant must be one or two characters long
get this when compiling my first c++ program can anyone out there help?
it is highlighting this line as the problem
...
|
by: Perrin |
last post by:
Hi, I am new to these forums so I don't know if this is the
appropriate place to post it, but Iam really stuck and I need help :(
I have this assignment with structs in C++. basically the...
|
by: Chris Dunaway |
last post by:
I am using the following code to test an .aspx page which has no
presentation and only a handler for the Page_Load event. I am using
this code to POST the contents of an .xml file to the .aspx...
|
by: HardHackz |
last post by:
Hey, I'm trying to learn C++, the problem is, when I do cout << "Hello
World!"; it always opens dos and closes it to quickly to see...i know
im a total n00b, but any help?
|
by: chaoticcranium |
last post by:
Right now, I am reading a file line by line using getline() using this
code:
// Read file line by line, store the first 3 values on each line
in a vector and store the vector in a vector of...
|
by: SM |
last post by:
Hello
i have a constant define like this
define('PHOTOGRAPHY', 'images/photography/');
The outpout (html) should look like this:
<img src"images/photography/123.jpg">
How do i insert a...
|
by: hockeyjk |
last post by:
All,
I'm writing a program that creates a histogram of data. IDLE is freezing up after the window opens (doesn't prompt user or graph anything). The window that opens is named "tk" rather than...
|
by: ig |
last post by:
First off, I'm a python n00b, so feel free to comment on anything if
I'm doing it "the wrong way." I'm building a discrete event simulation
tool. I wanted to use coroutines. However, I want to know...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |