How to add structures instead of using classes??

closed account (iyRG3TCk)
How to add structures instead of using classes??
Last edited on
I have to use data structures instead of using class

Change lines 9-10 from this:
class account

to this:
struct account

And you are done.
Edit: Reported for plagiarism, probably a troll.

There is some confusion:

struct and class are very similar.

A data structure is usually a container that holds multiple instances of information. Examples std::vector, A tree, a list, a map etc.

Further, a data structure may hold objects that are instances of a class or struct.

Which one are you asking about ? I guess you want both?

The code looks dodgy, did you write it yourself?

Found it:
Last edited on
LOL, I am always impressed by the amount of effort people will put into not just doing things themselves.
To be fair, it appears to be a bona fide starting point for school students.

The OP has been asked (probably legitimately) to do something with it ... it's just that his/her post isn't very clear as to what.
closed account (48T7M4Gy)
This poor bugger has been working on the same project since 2013.

I wonder why the code is so bad then?

This could be a typical troll tactic: trawl up some old and dodgy code, post it here with a vague question, then see if people waste their time fixing it.

I am not so trusting of someone's intent. A banking system is a poor choice for an assignment these days anyway: there are probably thousands of examples of code on the web already, and some on this site too.
Alas, homework assignments of this character are never going away. What I think has likely happened, however, is that OP found an example of code online that closely matches the wording in their assignment, but the class OP is taking has not covered OO yet. OP does not want to relinquish code that so closely matches the desired outcome, even if that code is not suited to the OP's assignment structure.

I'm not a huge fan of sites that have, right at the front, spots where it is plainly written for students to cheat:


NAME: your name here
SCHOOL: your school here

As a professor, I would immediately fail you in my class and put your name to the academic dishonesty department for attempted plagiarism, which would likely get you booted from school.
Last edited on
closed account (48T7M4Gy)
OP could give us contact details of his/her academic supervisor so we can verify that it's all OP's own work and what appears to be a close resemblance to somebody else's work is nothing more than a mere coincidence.

I don't think I would be alone in committing large amounts of free time helping OP out if that certification eventuated.
Topic archived. No new replies allowed.