| | |
How can I write a program with 3 classes?
![]() |
•
•
Join Date: Oct 2004
Posts: 6
Reputation:
Solved Threads: 0
Hello there, I have to write a program using three classes. One for the input, a second for the transaction, and a third one for the report. Can I write the three class definition in one header file? Can I write the three classes in one .CPP file?
Can I find an example of a program like this on the Internet?Thanks
Can I find an example of a program like this on the Internet?Thanks
Yes, you can write all the 3 class definations in one header file and implementation in one source file (in fact, you can write everything in one file as well).
C Syntax (Toggle Plain Text)
// Class delarations class A { A(); ~A(); void MethodOfA(); }; class B { B(); ~B(); MethodOfB(); }; class C { C(); ~C(); MethodOfC(); }; // Class Implmentations A::A() { // A ctor } A::~A() { // A ~ctor } void A::MethodOfA() { // MethodOfA } // ****************** B::B() { // B ctor } B::~B() { // B ~ctor } void B::MethodOfB() { // MethodOfB } // ****************** C::C() { // C ctor } C::~C() { // C ~ctor } void C::MethodOfC() { // MethodOfC }
Regards,
Ejaz.
Ejaz.
![]() |
Similar Threads
- how to write a program for power (C)
- Please some one write this program (C++)
- How can I write this program. (C++)
- How to write a program using a stack (C++)
- Trying to write a program that you can enter #s and multiply at the end. (Java)
- write a program that simulates rooling a pair of dice. (Java)
Other Threads in the C Forum
- Previous Thread: Array without twice the same number?
- Next Thread: How to use different colours?
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks bash binarysearch calculate centimeter changingto char character convert copyanyfile copyimagefile creafecopyofanytypeoffileinc createprocess() database dynamic execv fgets file floatingpointvalidation fork framework function getlogicaldrivestrin givemetehcodez grade gtkwinlinux histogram ide inches include infiniteloop initialization input interest intmain() iso keyboard km license linked linkedlist linux list looping lowest matrix meter microsoft number oddnumber open opendocumentformat openwebfoundation owf pdf pointer pointers posix power probleminc process program programming pyramidusingturboccodes radix read recursion recv recvblocked research reversing scheduling segmentationfault send sequential single socket socketprogramming standard strchr string suggestions systemcall test testautomation testing threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi





