In Java you can access variables in a class by using the keyword this
, so you don't have to figure out a new name for the parameters in a function.
Java snippet:
private int x;
public int setX(int x) {
this.x = x;
}
Is there something similar in C++? If not, what the best practice is for naming function parameters?