General discussion for hardware, software and programming shizzle.
Post a reply

Just useful now

13 Jan 2012, 10:23

You told me it would be better to make useful stuff in c++. Does a passworded user data storgage app sound better? Alomost done :3

Re: Just useful now

13 Jan 2012, 13:51

I got a problem, can someone help me?
Code:
add:



                                                        cout<< "Data: ";

                                                          getline(cin,tempvar);
                                                        if (tempvar == "E"||tempvar=="e") {
                                                                                            useractivefile<<"finish";
                                                                                            useractivefile.close();
                                                                                            cout << "File closed. Returning to possible options..."<<endl;
                                                                                            filenamex="";
                                                                                            delay(1);

                                                                                            goto useractive;

                                                                                            }


                                                                                                tempvar.insert(tempvar.length(),"@");
                                                                                                useractivefile<<tempvar;
                                                                                               

                                                                                                goto add;

This is the part of my code that writes to the file. But it dupes without any reason.
Here is what i get.
Code:
Write your data and type [E]xit when you are done.
Data: Data: (<- why does it dupe here) fdadsf
Data: dfdsafdsf
Data:

Why does it skip the code for no reason?

Re: Just useful now

13 Jan 2012, 15:20

Fixed: used a temporary string wich is goin to to be written to the file when the user wants to close the app, and then with a str.erase i erased the extra stuff
Edit: almost there :3
http://www.mediafire.com/?n68glbdi4gl3czk <- here it is. The book with registers and subregsiters. Still, lots left to add...
Post a reply