I have come across this virtual Keyword in C programming, but actually how it will helpful for the programmers.
Asked
Active
Viewed 144 times
-2
-
2"I have come across this virtual Keyword in C programming..." Please share a citation so we can see it in context. – Raymond Chen Feb 24 '22 at 05:09
-
see here: https://stackoverflow.com/questions/6844471/virtual-functions-in-c – Mike Feb 24 '22 at 05:39
1 Answers
11
Since your question is tagged with the C language, maybe you're confused.
The word virtual
is not a keyword in C. It is a keyword in C++, but it is not part of the C language at all -- not even a reserved word. You can use it as an identifier if you like. But don't, because you will limit your program's ability to be ported to C++.
In C++ it is used to declare a class member function that is polymorphic.

paddy
- 60,864
- 6
- 61
- 103