Search:

Type: Posts; User: loxslay

Search: Search took 0.02 seconds.

  1. I am soooo happy. I think I nailed this. I am...

    I am soooo happy. I think I nailed this. I am sure I can change some of the ints to chars or otherwise make it more efficient, however, I want to test the program first

    How can I change the...
  2. How can I access a struct (from a header file)?

    Ok, I am loving C++ so far. I am creating a card program. Here is a snippet of my header file.



    struct card
    {int value; char suit;};
    card c2={2,'c'}; card d2={2,'d'}; card s2={2,'s'}; card...
  3. Replies
    7
    Views
    5,976

    Thank you much for your help. A very funny thing...

    Thank you much for your help. A very funny thing happened...


    when I changed:
    myfile.open("test.txt", ios::app);

    to:
    myfile.open("test.txt", ios::out|ios::app);

    it started working. This...
  4. Replies
    7
    Views
    5,976

    Maybe I am just daft. The post you linked does...

    Maybe I am just daft. The post you linked does not help. I am not using ifstream and ofstream... I am using fstream.

    The documentation that I am using says that:

    when "myfile" is declared as...
  5. Replies
    7
    Views
    5,976

    restated

    Let me restate, I don't think I can use a real ofstream now (to append), because myfile is already declared as a type fstream. The compiler won't let me cross use them.
  6. Replies
    7
    Views
    5,976

    I have already declared it as fstream...

    Here is the whole program -

    #include <fstream>
    #include <iostream>
    using namespace std;

    int main()
    {
  7. Replies
    7
    Views
    5,976

    fstream ios:app troubles

    I have searched through many pages and have yet to find an answer...

    with
    fstream myfile;

    This snippet writes the line and works properly

    myfile.open("test.txt", ios::out);
    myfile <<...
Results 1 to 7 of 7