Creating a file in c++

Pages: 12
A couple of things. The field name will accept the first letter of the string, the rest will be considered to be part of the numeric value Balance. That of course will fail, and the input will not be able to proceed.

You might try something like this:
1
2
3
4
5
6
struct Reading {
    int Account;
    string Name;
    double Balance;
    Reading(int A, string N, double B):Account(A),Name(N),Balance(B){}
};

it still doesn't keep the names....nor anything else i guess...i'm trying to fix this since yesterday...i don't see the mistake...
You will also need to change Name in main() to type string.
i did that too...still doesn't work...
It works for me. Note in main() there is both name and Name, both should be of type string.

Last edited on
it does nothing when i run it...
Did you check whether it created the output file?
currently set to "D:\output.txt" but you may wish to change that.

Last edited on
i found another way..thanks anyway :D...is it possible to remove my code from here?
Last edited on
Well, normally we tend to leave the thread intact, as it may be helpful to someone else in the future. But this thread is particularly baffling as it was never clear where the real issue was. :)
could you please delete it?
Topic archived. No new replies allowed.
Pages: 12