Random stuff to learn how code operates. I get this error but I don't know what I'm doing wrong. Anyone care to explain what the issue may be and point me into some resources to better understand. THANKS!
ponter.c:5:3: error: expected identifier or ‘(’ before ‘{’ token
{
#include <stdio.h>
typedef struct {
char *testinput;
int i;
} labrat;
int main()
{
int z;
void addone(int z);
{
z++;
}
int n,a,x=1;
int *pointer_to_a = &a;
int *pointer_to_n = &n;
labrat test;
test.testinput="THis";
test.i = 5;
a+=1;
*pointer_to_a+=1;
scanf("Enter N value N is %d\n", pointer_to_n);
printf("THe value of n is %d\n", *pointer_to_n);
printf("N value is now %d\n", n);
printf("THe value of %d\n", a);
printf("The value of a is also %d\n", *pointer_to_a);
printf("%s is boring %d\n", test.testinput, test.i);
printf("%d is befor", x);
addone(z);
printf("%d is now", x);
}
/*###############################POINTERS#################################*/