typedef struct{

int*p;
}new;

void main(){
new *buffptr=malloc(sizeof(new));
buffptr->p;

}
my doubt is the above declaration in main function accesses the value of p and not the address of p. If I want to increment the address of p what should I do?

My sanskrit name is also Vikrant! How amazing is that? In any case, p++ works. You allocated buffptr and assigned it to p. So, p should be the address of the structure.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.