CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    Join Date
    May 2012
    Posts
    8

    Re: How to generate an auto ID (or Auto Number)

    Your previous post? which one?

  2. #32
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How to generate an auto ID (or Auto Number)

    This Forum is not for kidding!
    So, please choose: either
    Quote Originally Posted by J_Freak View Post
    Nah nah..just a basic program for my school project..
    or
    Quote Originally Posted by J_Freak View Post
    actually this is for a Bank
    Victor Nijegorodov

  3. #33
    Join Date
    May 2012
    Posts
    8

    Re: How to generate an auto ID (or Auto Number)

    Ahhh so sorry if I was not clear..its actually a project/assignment for school..and the assignment is about a bank..I've done everything else but couldn't figure out on how to do the "auto numbering" part..

  4. #34
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How to generate an auto ID (or Auto Number)

    Quote Originally Posted by J_Freak View Post
    Ahhh so sorry if I was not clear..its actually a project/assignment for school..and the assignment is about a bank..I've done everything else but couldn't figure out on how to do the "auto numbering" part..
    Well, didn't you read the whole thread from the very begin?
    Victor Nijegorodov

  5. #35
    Join Date
    May 2012
    Posts
    8

    Re: How to generate an auto ID (or Auto Number)

    ha..thanx alot I've figured out the way...but now caught up with another mess..
    all these details are suppose to be written to a "notepad" and this is the coding that I used for it

    void write_account()
    {
    account ac;

    ofstream outFile;
    outFile.open("Customer.txt",ios::in|ios::binary|ios::app);

    ac.new_account();
    outFile.write(reinterpret_cast<char *> (&ac), sizeof(account));
    outFile.close();
    }

    but I'm not getting the output properly..its like jumbled with unknown characters...

    What's the issue here?

  6. #36
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: How to generate an auto ID (or Auto Number)

    Quote Originally Posted by J_Freak View Post
    that I used for it
    Code:
    void write_account()
    {
    	account ac;
    
    	ofstream outFile;
    	outFile.open("Customer.txt",ios::in|ios::binary|ios::app);
    
    	ac.new_account();
    	outFile.write(reinterpret_cast<char *> (&ac), sizeof(account));
    	outFile.close();
    }
    but I'm not getting the output properly..its like jumbled with unknown characters...
    P Lease, use Code tags. Otherwise your code is hard to read/understand.
    What is account? And why do you cast account* to char*?
    Victor Nijegorodov

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured