Point and Serial.println My funtion

What I'm trying to do is print out my int x which is declared in my function (bottom part of code). I'm trying to print it out in my main loop. It does not work and clearly I'm not understanding a basic principle of functions. However, I'm sure there is a way to do what I'm asking and it would save me a great deal of coding because I need to reference it quite a few times in a state change system. What is the rright code for what I'm asking?

void setup() {
Serial.begin(9600);
}


void loop() {

int y;

thisFunction(y);

Serial.println (y);

}


void thisFunction(int x){
  
  int reading = analogRead(A0);
  int fixReading = (500-reading);
  int x = (abs)fixReading
  
  }

You did a great job explaining this - thank you! I will try it

It is rather pointless to use pass-by-reference when the function return type is void. Change the return type to int, and don't pass anything to the function, since the function doesn't use the value passed in (which is garbage, as y is never initialized).