Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Bonsai Boy of New York Bonsai Trees and Accessories

BlueHost Web Hosting

Liquid Web iThemes WordPress Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Liquid Web Cloud VPS Hosting

10,567 questions

14,363 answers

573 users

How to use pointer to pointer in C

3 Answers

0 votes
#include <stdio.h>

int main(int argc, char **argv)
{
    int n = 7, *p = &n, **pp = &p;
	
	printf("%d\n", n);
	printf("%d\n", *p);
	printf("%d\n", **pp);
	
    return 0;
}


/*
run:

7
7
7

*/

 




answered Dec 24, 2018 by avibootz
edited Jun 30 by avibootz
0 votes
#include <stdio.h>

int main(int argc, char **argv)
{
    int n = 7, *p = &n, **pp = &p;
	
	printf("%d\n", n);
	printf("%d\n", *p);
	printf("%d\n", **pp);
	
	// address of n
	printf("%p\n", &n);
	printf("%p\n", p);
	printf("%p\n", *pp);
	
    return 0;
}


/*
run:

7
7
7
000000000062FE44
000000000062FE44
000000000062FE44

*/

 




answered Dec 24, 2018 by avibootz
edited Jun 30 by avibootz
0 votes
#include <stdio.h>

int main() {
    int n = 99;
    int *p;
    int **pp;

    p = &n;
    pp = &p;

    printf("n = %d\n", n);
    printf("*p = %d\n", *p);
    printf("**pp = %d\n", **pp);

    return 0;
}



/*
run:

n = 99
*p = 99
**pp = 99

*/

 




answered Jun 30 by avibootz
...