/*
++*p pre increment -> only value will be incremented 

Here value of the variable gets inclemented to the next value after execution
of the current line the value will be updated

ex:-
*/
#include <stdio.h>
///*

int main(){
    int *p;
    int n=10;

    p = &n;

    printf("%d",++*p);
}

//*/
/*

*p++ post increment -> only the address will be incremented

Here the address is incremented in the current line 
if int data type and address is 1000 the is incremented to 1004 if char data type
1000 is incremented to 1001

note:- the address of the pointer remains same 4byte for 32bit
       and 8byte for 64 bit system or the address holding capacity name in hex

*/

/*
int main(){
    int *p;
    int n=10;

    p = &n;

    printf("%d",*p++);
}

*/

/*
int main(void)
{
	int arr[] = {10, 20};
	int *p = arr;
	*p++;
	printf("arr[0] = %d, arr[1] = %d, *p = %d",
						arr[0], arr[1], *p);
	return 0;
}
*/

/*

*++p -> only the address will be incremented

Here the address is incremented in the next line 
if int data type and address is 1000 the is incremented to 1004 if char data type
1000 is incremented to 1001

note:- the address of the pointer remains same 4byte for 32bit
       and 8byte for 64 bit system or the address holding capacity name in hex 
       
*/



Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: