I know other versions of this questions exist, but all of the answers for them confuse my beginner brain. All I am trying to do is take a single number as input and then output it, here is the code:
#include <stdio.h>
#include <stdlib.h>
int main() {
int var;
scanf("%u\n", var);
printf("%d\n", var);
}
and the error message I got:
warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 2 has type ‘int’ [-Wformat=]
The weird thing is that I tried all the format specifiers for integers that I could think of (%d %u %i) and they all returned a similar error.
I'm still a beginner in C so this might be a really stupid question but go easy on me lol