#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main() {
int a[] = {5, 15, 34, 54, 14, 2, 52, 72};
int p = &a[1];
int q = &a[5];
printf(*(p+3));
printf(*(q-3));
printf(*(q-p));
printf(*p<*q);
return (EXIT_SUCCESS);
}
Errors: "initialization makes integer from pointer without a cast [-Wint-conversion]" and "invalid type argument of unary '*' (have 'int')". First error is shown twice for the initialisation of variables above. Second error is shown for each print statement.
I'm not sure what is going wrong, anyone know how I can fix this?