I learn C++, pointers/references, some basic stuff. I made a little program that calculate difference between two times. My program works fine, but i have no idea why it returns a big value like 123123123:53442344 at the end when there are a & signs before variables. There`s a code of my program
#include <iostream>
#include <stdio.h>
int main() {
int userHour, userMinutes;
printf_s("Enter first hour: ");
scanf_s("%d:%d", &userHour, &userMinutes);
int difference = userHour * 60 + userMinutes;
printf_s("Enter second hour: ");
scanf_s("%d:%d", &userHour, &userMinutes);
difference = abs(difference - (userHour * 60 + userMinutes));
userHour = difference / 60;
userMinutes = difference % 60;
printf("Difference is %02d:%02dh", &userHour, &userMinutes);
}
The problem is in the last line of code, i couldn't find an answer in a debugger or Google (inb4 i'm pretty new in programming, show me how to look for answers :( )