Im confused what virtual int and virtual string means.
Moreover, I’m confused what the prefix “virtual” has to do with anything; I have a feeling it has to do with vectors.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
virtualhas nothing to do with theint, nor does it have anything to do with vectors. Theintspecifies the type of value the function returns when it’s done. Thevirtualspecifies that the function call be handled in a special way that’s related to inheritance.I expect this question has duplicate answers on here already. Search for stuff about the
virtualkeyword in C++.Your question is a very elementary C++ question, and I believe a full explanation of what
virtualmeans is outside the scope of what StackOverflow can help you with anyway. You should find a nice beginners C++ book.