Preface: I certainly consider myself a beginner, but I don't know if this is a "beginner" issue, so this might be the wrong forum.
So, I have this program that reads from a text file, puts stuff from the text file (called todDb.txt) into an array of objects, asks if you want to change any info, lets you change the info, and then writes it back to the text file once you're done.
todDb.cpp:
http://pastebin.com/F1qWkpq9
todDb.txt:
http://pastebin.com/cyR6PEec
My issue is, depending on the computer it's compiled on (
all using Visual C++ 2010 command line compiler), it hangs for anywhere from 30 seconds to 2 minutes before continuing to run normally. If I compile it on a computer that doesn't have this issue, and take the .exe to a computer that does have this issue, the problem isn't there. So that's how I know it's a compiler issue.
But! If I have code that checks if the file is invalid, and exits the program if it is invalid, the problem is no longer there, even though that "if" is never triggered. (I have actually included this code, commented out, in lines 25-29.)
I've since modified that program to use fstream binary input, and putting file validity checking doesn't do anything to help the hanging issue anymore.
todDbB.cpp:
http://pastebin.com/LDmfj5KS
(has to be run once without loading the database file, in order to create todDb.dat)
Computers where I have this issue:
My personal desktop, built myself: Windows 7 Ultimate 64 bit
My Asus EEE PC netbook: Windows 7 Ultimate 32 bit (freshly re-installed VC++ 2010)
My girlfriend's Asus laptop: Windows 7 Home Premium 64 bit (freshly installed VC++ 2010)
Computers I don't have this issue:
The computers in the computer lab at school: Windows 7 64 bit (don't know what version, or manufacturer)
My parent's prefab HP desktop: Windows 7 Home Premium 64 bit (freshly installed VC++ 2010)
At first I thought it had something to do with me having changed registry values to do things like be able to have a custom background image on my login screen and other stupid stuff, and other customizations I've made to windows, but my girlfriend's computer has none of that kind of stuff done to it, so I don't know what's wrong in the slightest.
If there's any more information I can provide, let me know