Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

hi.can any one tell me plz how can i use a class in another class in c++?

Computer Science
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
Classes are usually used by instantiating them. So, inside a member function somewhere you'll do something like this... ``` MyAwesomeClass* awesomeClass = new MyAwesomeClass(); ``` That will give you a pointer named awesomeClass pointing to an instance of the MyAwesomeClass. You'll want to make sure that the header file for MyAwesomeClass is also included in the same file this line is used in, or things don't work so well. :)
http://www.cplusplus.com/doc/tutorial/inheritance/ this article will help you more in how to use a class inside another class in c++

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question