Read value from analog input of an AVR microcontroller?
First define INT photoresistorvalue outside of the while loop, as you don't want it to initialize it every loop.

Then inside of the while loop, it would be as simple as

 photoresistorvalue = ADCW;


ADCW should be the ADC result register for AVR microcontrollers, but could vary by family or ADC type.