User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 361,561 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,033 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 362 | Replies: 11
Reply
Join Date: Apr 2008
Location: Kyrgyzstan
Posts: 4
Reputation: WondererAbu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
WondererAbu WondererAbu is offline Offline
Newbie Poster

SMS(student managent system)

  #1  
May 12th, 2008
Can you explain me how to link classes with each other?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: India
Posts: 235
Reputation: Agni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 33
Sponsor
Agni's Avatar
Agni Agni is offline Offline
Posting Whiz in Training

Re: SMS(student managent system)

  #2  
May 12th, 2008
... dude.... what do you mean by 'link classes' ?
thanks
-chandra
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 9,872
Reputation: Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold 
Rep Power: 31
Solved Threads: 793
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Posting Prodigy

Re: SMS(student managent system)

  #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.
This is our time to turn the page on the politics of the past. -- Sen. Barack Obama
If the people cannot trust their government to do the job for which it exists - to protect them and to promote their common welfare - all else is lost.
Barack Obama
Reply With Quote  
Join Date: Dec 2006
Location: india
Posts: 1,009
Reputation: vijayan121 is a glorious beacon of light vijayan121 is a glorious beacon of light vijayan121 is a glorious beacon of light vijayan121 is a glorious beacon of light vijayan121 is a glorious beacon of light vijayan121 is a glorious beacon of light 
Rep Power: 9
Solved Threads: 152
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: SMS(student managent system)

  #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  
Join Date: Apr 2008
Location: Kyrgyzstan
Posts: 4
Reputation: WondererAbu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
WondererAbu WondererAbu is offline Offline
Newbie Poster

Re: SMS(student managent system)

  #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  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 9,872
Reputation: Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold Ancient Dragon is a splendid one to behold 
Rep Power: 31
Solved Threads: 793
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Posting Prodigy

Re: SMS(student managent system)

  #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?
class base
{
   // blabla
};

class derived : public base
{
    // linked (derived) class
};
This is our time to turn the page on the politics of the past. -- Sen. Barack Obama
If the people cannot trust their government to do the job for which it exists - to protect them and to promote their common welfare - all else is lost.
Barack Obama
Reply With Quote  
Join Date: May 2006
Location: homeworkhelp.co.in
Posts: 790
Reputation: ithelp is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 59
ithelp ithelp is offline Offline
Master Poster

Re: SMS(student managent system)

  #7  
May 19th, 2008
I guess you mean
  1. class A {
  2.  
  3. };
  4. class B {
  5. A a;
  6. };
Reply With Quote  
Join Date: Mar 2008
Location: India, Kerala
Posts: 24
Reputation: RenjithVR is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
RenjithVR RenjithVR is offline Offline
Newbie Poster

Re: SMS(student managent system)

  #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  
Join Date: Dec 2007
Location: India
Posts: 235
Reputation: Agni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 33
Sponsor
Agni's Avatar
Agni Agni is offline Offline
Posting Whiz in Training

Re: SMS(student managent system)

  #9  
May 20th, 2008
Are we playing 'Read My Mind' here ...
thanks
-chandra
Reply With Quote  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,457
Reputation: niek_e is a jewel in the rough niek_e is a jewel in the rough niek_e is a jewel in the rough 
Rep Power: 6
Solved Threads: 148
niek_e's Avatar
niek_e niek_e is offline Offline
Nearly a Posting Virtuoso

Re: SMS(student managent system)

  #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 3:27 am.
"= != =="

PM's asking for help will be ignored..
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Other Threads in the C++ Forum

All times are GMT -4. The time now is 2:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC