Can we write abstract keyword in C++ class?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- es 单字段多分词器时,textField.keyword无法高亮
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
No, you can't use abstract as a keyword because there is no such keyword available in C++.
If you want make a class as an in C++ abstract you can declare at least one function as pure virtual function.
But in derived class you must provide definition else its give compilation error .
Example:
note:
You can used abstract as a variable name, class name because, as I told you, abstract is not a keyword in C++.
It is a keyword introduced as part of the C++/CLI language spefication for the .NET framework.
No, C++ has no keyword abstract. However, you can write pure virtual functions; that's the C++ way of expressing abstract classes.