hi everybody im a beginner in C and im still confused with pointers so ihave a question
if we consider this tiny program
int a = 5
int *ptr
int nptr
whats the difference between those lines [below]?? what happens in memory ??
ptr = a
ptr = &a
nptr = &a

Every statement has to end with a ;
ptr = a; It is not possible to assign the integer a to the pointer ptr.
The reverse happens here nptr = &a; You cannot assign the address of integer a(a pointer) to the integer nptr.

commented: thankss +1
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.