okay guys this the program in which we have to add a record,modify it or delete it. it adds and shows it successfully but whenever we want to delete a record it doesn't. When we add to records and delete the second one ,the list looks like this,
soche123 0 Junior Poster in Training
Recommended Answers
Jump to PostDon't send us the code. Post the code.
#include <cstdlib> #include <iostream> #include <conio.h> using namespace std; int i; int size=0; struct employRecord { string firstName; string lastName; int age; string department; string qualification; }; void addRecord(); void listRecord(); void modifyRecord(); void deleteRecord(); struct employRecord empl[100]; int …
Jump to PostHere's some code for you.
I modified your delete routine move the record to the empty part of the array.
I added code throughout to use the size variable as the end of the records and to check for out of bounds conditions.
I removedi
from the global …
Jump to PostThe basic structure of your program is using an array. However you only need to work with a portion of it. The
size
variable tells the code which part of the array is useable. To delete a record all my code does is move the record to the bottom of …
Jump to Postchange this
if(i< size)
(ine 133) to thisif(i<= size)
Jump to PostThe basic structure of the program is using an array to store the data. However only a portion of it is needed. The size variable tells the code which part of the array is useable.
Adding a record merely updates the data on the first index after the useable portion …
All 17 Replies
NathanOliver 429 Veteran Poster Featured Poster
JasonHippy 739 Practically a Master Poster
Moschops 683 Practically a Master Poster Featured Poster
Moschops 683 Practically a Master Poster Featured Poster
Moschops 683 Practically a Master Poster Featured Poster
soche123 0 Junior Poster in Training
Moschops 683 Practically a Master Poster Featured Poster
soche123 0 Junior Poster in Training
tinstaafl 1,176 Posting Maven
soche123 0 Junior Poster in Training
soche123 0 Junior Poster in Training
soche123 0 Junior Poster in Training
tinstaafl 1,176 Posting Maven
soche123 0 Junior Poster in Training
tinstaafl 1,176 Posting Maven
soche123 0 Junior Poster in Training
tinstaafl 1,176 Posting Maven
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.