ankit
ankit

Reputation: 917

"Virtual" is qualifier or keyword in C++?

"Virtual" is qualifier or keyword in C++?

Upvotes: 2

Views: 593

Answers (3)

CB Bailey
CB Bailey

Reputation: 791869

virtual is a keyword and a function-specifier. It's not a qualifier. C++ only talks about cv-qualifiers (i.e. const and volatile); the only other uses of the word qualifier refer to scope resolution prefixes (i.e. global :: and ns:: and class_name:: prefixes) in qualified ids.

Upvotes: 13

Chubsdad
Chubsdad

Reputation: 25497

'virtual' is a keyword and a qualifier. C++ is case sensitive and won't understand 'Virtual'.

Upvotes: 3

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272497

It's both a qualifier and a keyword!

Upvotes: 3

Related Questions