Search:

Type: Posts; User: mosdef

Search: Search took 0.00 seconds.

  1. Replies
    12
    Views
    1,168

    Does this method work only for Windows or will it...

    Does this method work only for Windows or will it work for Linux too?
  2. Replies
    7
    Views
    2,979

    Also, are there excessive seekg's I can remove? ...

    Also, are there excessive seekg's I can remove? Thanks again! It works!
  3. Replies
    7
    Views
    2,979

    Thanks, what does clearing an ifstream do?

    Thanks, what does clearing an ifstream do?
  4. Replies
    6
    Views
    2,046

    Just a tip, use the [ code ] tag. #include...

    Just a tip, use the [ code ] tag.



    #include <stdio.h>
    int main() {
    FILE *outp;
    char *output_filename;

    output_filename = "output.txt";
  5. Replies
    7
    Views
    2,979

    I opened all the files for both input and output,...

    I opened all the files for both input and output, so that's not the problem. Well here goes...




    #include <iostream>
    #include <string>
    #include <fstream>

    using namespace std;
  6. Replies
    7
    Views
    2,979

    Problems with fstreams.

    In my program, I am reading in a file ("source" - cannot be overwritten) and copying it to another file ("target") by reading and writing one line at a time. I am manipulating the data found in...
  7. Replies
    5
    Views
    927

    Thanks for your help!

    Thanks for your help!
  8. Replies
    5
    Views
    927

    Also, is there any easy way to get the name of...

    Also, is there any easy way to get the name of the file which the fstream was opened on? That is, given an fstream, can you give me the name of the file the fstream is "pointing to"?
  9. Replies
    5
    Views
    927

    So the following line will erase the contents of...

    So the following line will erase the contents of a.txt?



    fstream target( "a.txt", ios :: out );
  10. Replies
    5
    Views
    927

    Erasing the contents of a file?

    What is the quickest way to erase the contents of an fstream? I don't want to delete the file, just make it blank.
  11. Sorry, what I meant was basically "do not open...

    Sorry, what I meant was basically "do not open the file if it already exists." I don't want to be able to write to a file if it already exists.
  12. Great, that helps a lot. My only question then...

    Great, that helps a lot. My only question then is how do I ensure that I am not opening a pre-existing file for output; in other words, I wish to prevent any sort of overwriting. Thanks again!
  13. Can you have an ifstream and ofstream open for one file at once + no overwriting?

    This is my first post, so please go easy on me ;).

    I intend to both read from and write to a file. Can I have an ifstream and ofstream open for the same file at the same time? Or do I have to...
Results 1 to 13 of 13