hi,
the following program is not running and give cannot convert int to int * in main function error
#include<stdio.h>
void main()
{
int *p;
p=0x2000;
++p;
printf("%x",p);
}
hi,
the following program is not running and give cannot convert int to int * in main function error
#include<stdio.h>
void main()
{
int *p;
p=0x2000;
++p;
printf("%x",p);
}
While your intentions are unclear as the purpose of your program, the following two lines are the root of your problem. The first defines "p" as a pointer to an integer, the second assign an value of type integer to the pointer. The pointer to an integer "p" can only contain a valid address, not an integer such as 0x2000.