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...
Type: Posts; User: loxslay
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...
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...
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...
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...
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.
Here is the whole program -
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
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 <<...