Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
BlueHost Web Hosting

Bonsai Boy of New York Bonsai Trees and Accessories

Liquid Web iThemes WordPress Hosting

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

DreamHost Web Hosting


getResponse autofunnels

Liquid Web Cloud VPS Hosting

Disclosure We are a professional Information website that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

12,128 questions

16,523 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, 2019 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, 2019 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, 2019 by avibootz
...