Thread: .....Class building

  1. #1
    Registered User Clayg's Avatar
    Join Date
    Nov 2011
    Location
    Hawaii
    Posts
    20

    .....Class building

    I am begining to understand the general idea of building and using a class. I have two diffferent begining c++ books that have enough information in them to make me realize I don't know enough. I would like to read a tutorial that completely excersises class building from "novice" to "semi-pro" to include strings and other types of variables not just integers. Is there a book dedicated to this topic or an extensive online tutorial? Thanks in advance and Happy new years.

  2. #2

  3. #3
    Registered User Clayg's Avatar
    Join Date
    Nov 2011
    Location
    Hawaii
    Posts
    20
    I have been reading the cplusplus for the last few hours, I will read through the c++ faq next. Thanks I realy appreciate it.

    I wonder how many years I will wander the streets of code until I realize where I am.

  4. #4
    Registered User Clayg's Avatar
    Join Date
    Nov 2011
    Location
    Hawaii
    Posts
    20
    ...*sigh*,What is the dif between a default contsructor and a constructor with parameters? They are both setting the rule of initialization of the new objects variables, right? So why would I declare more than one contstructor(I understand why the copy constructor is useful)?
    I wonder how many years I will wander the streets of code until I realize where I am.

  5. #5
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Clayg View Post
    ...*sigh*,What is the dif between a default contsructor and a constructor with parameters? They are both setting the rule of initialization of the new objects variables, right? So why would I declare more than one contstructor(I understand why the copy constructor is useful)?
    You may want to make the same object in many different ways...
    For example ..if you have a class called book, you may decide to construct objects using the book name and its author's name ....or if you have those details in a database, you can only take the..say.. isbn as the parameter and fill the object with the data obtained from the database.
    The default constructor does not take any argument and it is needed to make a default object without any input from the program.

  6. #6
    Registered User Clayg's Avatar
    Join Date
    Nov 2011
    Location
    Hawaii
    Posts
    20
    donyavhat, I am sure I miss spelled that. Thank you. I feel a bit clearer on the subject.
    I wonder how many years I will wander the streets of code until I realize where I am.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Building a class in a single file
    By Amoxaphobic in forum C++ Programming
    Replies: 5
    Last Post: 11-10-2011, 02:34 PM
  2. GUI building, is RAD the way to go?
    By indigo0086 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-21-2007, 09:36 PM
  3. building a DLL
    By sass in forum C++ Programming
    Replies: 1
    Last Post: 03-02-2006, 05:25 AM
  4. need help with building DLL
    By Frantic- in forum C++ Programming
    Replies: 6
    Last Post: 06-25-2005, 11:10 PM
  5. building a class
    By jlmac2001 in forum C++ Programming
    Replies: 5
    Last Post: 02-22-2003, 11:35 PM