Ask Question

Using C++, Write a full class definition for a class named Acc1, containing no constructors, functions, or data members (i. e., a totally empty class). (Note, the last character of the classname is "one" not "ell".)

+3
Answers (1)
  1. 10 October, 18:43
    0
    Hi!

    Okay, so -

    To make a C + + class, we have to use the keyword class followed by the class name, and a pair of curly braces which will be our class body.

    Our class body is what holds all of our constructors, functions, and data members.

    So, to write a completely empty class - we would just have to simply write:

    class Acc1

    {

    };

    Note -

    All classes must end with a semi colon! This is just a standard rule we follow since it was how C + + has been defined. If you were to leave the semi colon out, you would get a compiler error! = )
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Using C++, Write a full class definition for a class named Acc1, containing no constructors, functions, or data members (i. e., a totally ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers