my question is : I have this code written in c++11 :
#include <iostream>
#include <string>
using namespace std;
class A{
public:
void print() const {cout << "a" << endl ;}
};
void f(const A& a){
a.print();
}
and I want to edit this code by adding to it but not removing anything, so it would print the letter "b" instead of "a" no matter the input. How is that possible? I haven't found an answer on the internet ?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire