using virtual in class

 

I read the documentation for using virtual in class

but I cant set virtual to a string or double variable

when i use it with bool or void it works fine

How can i use it in double, string or int variables inside a class?

 
Arpit T:

I read the documentation for using virtual in class

but I cant set virtual to a string or double variable

when i use it with bool or void it works fine

How can i use it in double, string or int variables inside a class?

The keyword virtual is a modifier for member functions, not for variables.

 
Dominik Egert #:
The keyword virtual is a modifier for member functions, not for variables.

Yes I mean member function, How can i use it in double, string or int member functions inside a class?

 
Arpit T #:

Yes I mean member function, How can i use it in double, string or int member functions inside a class?

Please share your code.