SMS(student managent system)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 4
Reputation: WondererAbu is an unknown quantity at this point 
Solved Threads: 0
WondererAbu WondererAbu is offline Offline
Newbie Poster

SMS(student managent system)

 
0
  #1
May 12th, 2008
Can you explain me how to link classes with each other?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 459
Reputation: Agni is a jewel in the rough Agni is a jewel in the rough Agni is a jewel in the rough Agni is a jewel in the rough 
Solved Threads: 71
Sponsor
Agni's Avatar
Agni Agni is offline Offline
Posting Pro in Training

Re: SMS(student managent system)

 
0
  #2
May 12th, 2008
... dude.... what do you mean by 'link classes' ?
thanks
-chandra
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,585
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1487
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: SMS(student managent system)

 
0
  #3
May 12th, 2008
You could use a std::vector, or std::list, or write your own linked list. If that isn't what you want then we have no idea what you mean.
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: SMS(student managent system)

 
0
  #4
May 12th, 2008
> how to link classes with each other?
classes are types. are you looking for how to implement a typelist?
a tutorial introduction to typelists: http://www.ddj.com/cpp/184403813?_requestid=1305388
you might then want to read Alexandrescu's Modern C++ Design (Addison-Wesley Longman, 2001).
and look up Boost.MPL http://www.boost.org/doc/libs/1_35_0...doc/index.html which has a ready made framework for template metaprogramming. eg.
  1. #include <boost/mpl/vector.hpp>
  2. #include <boost/mpl/push_front.hpp>
  3. #include <boost/mpl/push_back.hpp>
  4. #include <boost/mpl/replace.hpp>
  5. #include <boost/mpl/at.hpp>
  6. #include <boost/mpl/int.hpp>
  7. #include <boost/mpl/assert.hpp>
  8.  
  9. class A{} ; class B{} ; class C{} ; class D{} ; class E{} ;
  10.  
  11. int main()
  12. {
  13. using namespace boost ;
  14.  
  15. typedef mpl::vector<A,B> seq_ab ;
  16. typedef mpl::push_front< seq_ab, C >::type seq_cab ;
  17. typedef mpl::push_back< seq_cab, D >::type seq_cabd ;
  18. typedef mpl::replace< seq_cabd, B, E >::type seq_caed ;
  19.  
  20. BOOST_MPL_ASSERT(
  21. ( mpl::is_same< mpl::at< seq_caed, mpl::int_<2> >, E > ) ) ;
  22. }
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 4
Reputation: WondererAbu is an unknown quantity at this point 
Solved Threads: 0
WondererAbu WondererAbu is offline Offline
Newbie Poster

Re: SMS(student managent system)

 
0
  #5
May 19th, 2008
Originally Posted by Agni View Post
... dude.... what do you mean by 'link classes' ?
There are many classes which must be link or in other words put together in order to work as one big class.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,585
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1487
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: SMS(student managent system)

 
0
  #6
May 19th, 2008
Originally Posted by WondererAbu View Post
There are many classes which must be link or in other words put together in order to work as one big class.
Oh, do you mean inheritence?
  1. class base
  2. {
  3. // blabla
  4. };
  5.  
  6. class derived : public base
  7. {
  8. // linked (derived) class
  9. };
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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,857
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 120
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: SMS(student managent system)

 
0
  #7
May 19th, 2008
I guess you mean
  1. class A {
  2.  
  3. };
  4. class B {
  5. A a;
  6. };
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 41
Reputation: RenjithVR is an unknown quantity at this point 
Solved Threads: 7
RenjithVR RenjithVR is offline Offline
Light Poster

Re: SMS(student managent system)

 
0
  #8
May 20th, 2008
I think you are thinking about including a file in another file. Write a main function in one file and include the needed header files with that file. Also in each class include the header files they required. The below link will give you a small idea about this.
http://www.eventhelix.com/RealTimeMa...dePatterns.htm

To compile these classes its better to use a Makefile. The following link will guide through how to write and use a Makefile.
http://www.sethi.org/classes/cet375/...mpilation.html
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 459
Reputation: Agni is a jewel in the rough Agni is a jewel in the rough Agni is a jewel in the rough Agni is a jewel in the rough 
Solved Threads: 71
Sponsor
Agni's Avatar
Agni Agni is offline Offline
Posting Pro in Training

Re: SMS(student managent system)

 
0
  #9
May 20th, 2008
Are we playing 'Read My Mind' here ...
thanks
-chandra
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,963
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 308
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: SMS(student managent system)

 
0
  #10
May 20th, 2008
Originally Posted by Agni View Post
Are we playing 'Read My Mind' here ...
In theory, if we supplied ∞ answers, the right one would be among them


So I'll have a look in my crystal ball and say....: Namespaces!

  1. #include <iostream>
  2.  
  3. namespace ClassSpace
  4. {
  5. class a
  6. {
  7. public:
  8. a() { std::cout << "Created A\n";}
  9. ~a(){ }
  10. };
  11. class b
  12. {
  13. public:
  14. b(){ std::cout << "Created B\n";}
  15. ~b(){}
  16. };
  17. }
  18.  
  19. int main()
  20. {
  21. ClassSpace::a Ca;
  22. ClassSpace::b Cb;
  23. std::cin.get();
  24. return 0;
  25. }
Last edited by niek_e; May 20th, 2008 at 4:27 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC