Am having an assignment on modular programing.
the program ( VCD system) must
(1) Initialize database,
(2) Add a record for VCD
(3) delete record for a VCD
(4) Print out all VCD
(5) save to text file
(6) Load from text file.

have actually worked on it but i just can't get pass the errors.. it's really killing me..
can i get someone to check my program?.. problem solving is one hell of a headache for me..

am attaching the assignment to this message...........

please guys, come to my rescue...
thanks in advance

Dani AI

Generated

A compact troubleshooting addendum for the VCD assignment that builds on points raised by and the OP . The following checklist and tiny examples are intended to make the build/link/file-I/O problems visible and fixable quickly, without changing the program design.

Keep the build simple and consistent. All .cpp/.h files must be part of a single project/target (only one main). If the project uses precompiled headers (VC++6 common), each .cpp should include the precompiled header first. Declarations in headers must match definitions exactly (return type, name, parameter types, const qualifiers). Use include guards. Example header/definition pattern:

// prompt.h
#ifndef PROMPT_H
#define PROMPT_H

void ShowMenu();

#endif

// prompt.cpp
#include "prompt.h"
void ShowMenu() { /* implementation */ }

Make file I/O robust and symmetric. Always include <fstream> and <string>, pick one filename constant used for both save and load, and check that stream objects opened successfully before reading or writing:

#include <fstream>

const char* DATA_FILE = "vcd_db.txt";
std::ofstream out(DATA_FILE);
if (!out) { /* report error / abort save */ }

Use a simple, unambiguous record format (one record per line, a safe delimiter like '|'), parse with getline + stringstream, and escape delimiters if fields can contain them.

A practical debugging workflow: (1) fix compile errors first, (2) read linker errors to find missing symbols or signature mismatches, (3) confirm every .cpp with a needed definition is added to the project, (4) add small unit tests or a minimal main that exercises add/delete/save/load, and (5) rebuild frequently. Typical causes remaining after this are typos in identifiers, mismatched prototypes/definitions, or a file omitted from the project.

Recommended Answers

All 3 Replies

prompt.h: missing the return type of all functions.
prompt.cpp: ditto (same problem)

your zip file contains 4 different projects. That's not what you want. You need to put all those files into just one project so that they can all be linked together.

commented: Kudos for taking the time to look. +17

prompt.h: missing the return type of all functions.
prompt.cpp: ditto (same problem)

your zip file contains 4 different projects. That's not what you want. You need to put all those files into just one project so that they can all be linked together.

Thanks....
i was using Vc++ 6 to write the program initially.
have added it to a project now..
thanks in advance

That zip file doesn't include the *.cpp and *.h files so I just copied them from your last *.zip file.

Continuing from where I left off
vcdrec.cpp: you forgot to include <fstream> which is where ifstream is declared.

Then you misspell the name of the ifstream object every time you used it.

You have confused Load_Record_From_File() and Load_Save_To_File(). Switch the code in those two functions around. And I think the filename used in both those functions should be the same. You can't write the data to one file and expect to read from a different file.

After correcting all the above your program is left with several functions you have not yet coded. The link error messages will tell you which functions are missing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.