| | |
HELP!!!! can't locate the error
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I have an assignment in Modular programming..
Have been able to make the program work... the lil problem am having now is that when i try to load the file i created, it keeps adding the memory location. Moe like it's adding an additional data insead of just loading the initial file.. can anyone help me with this?..
have attached a copy of my assignment to this message.. was trying to zip it but the school server was kinda acting funny..
thanks in Advance
Have been able to make the program work... the lil problem am having now is that when i try to load the file i created, it keeps adding the memory location. Moe like it's adding an additional data insead of just loading the initial file.. can anyone help me with this?..
have attached a copy of my assignment to this message.. was trying to zip it but the school server was kinda acting funny..
thanks in Advance
•
•
•
•
PS: it's written in VC++ 6 so i don't know if it can be a problem for Vc++2008...
1) prompt.h and prompt.cpp -- you need to specify function return values.
2) program is using uninitialized struct member in function Add_vcd(). You can fix that problem by adding a class constructor to the structure which initializes it.
There appear to be other problems too, such as displaying junk records.
2) program is using uninitialized struct member in function Add_vcd(). You can fix that problem by adding a class constructor to the structure which initializes it.
struct vcdDB_T{
vcdRec_T vcdRecords[maxSize];
int vcdIndex;
public:
vcdDB_T() {vcdIndex = 0;}
};There appear to be other problems too, such as displaying junk records.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Well you do use eof() in a control loop, which is bad
http://faq.cprogramming.com/cgi-bin/...&id=1043284351
eof() is a state (the result of a past failure), not a prediction (of a future failure).
That is, if you have a 10 char file and read 10 chars, then eof() will NOT be true. It's only when you try to read (and fail) to read the 11th char that eof() will become true.
The corrollary of all this is that ALL your file read functions should check their return result to see that they succeeded.
http://faq.cprogramming.com/cgi-bin/...&id=1043284351
eof() is a state (the result of a past failure), not a prediction (of a future failure).
That is, if you have a 10 char file and read 10 chars, then eof() will NOT be true. It's only when you try to read (and fail) to read the 11th char that eof() will become true.
The corrollary of all this is that ALL your file read functions should check their return result to see that they succeeded.
![]() |
Similar Threads
- Win XP stop error (Windows NT / 2000 / XP)
- How to download a file (Java)
- RUNDLL Error Message at Boot (Viruses, Spyware and other Nasties)
- Error loading "bridge.dll" (Viruses, Spyware and other Nasties)
- Bridge.dll error (Viruses, Spyware and other Nasties)
- Error message missing bridge.dll when starting windows (Viruses, Spyware and other Nasties)
- svchost.exe error (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: struct
- Next Thread: OpenGL in C++
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game generator getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python random read recursion recursive return sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






