Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Create your online store today with Shopify

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Disclosure: My content contains affiliate links.

43,700 questions

57,013 answers

573 users

How to pass the address of a pointer to a function in C

1 Answer

0 votes
#include <stdio.h>

void changeValue(int **p) {
    **p = 700;
}
    
int main()
{
    int n = 15;
    int *p = &n;
    
    printf("%d %d\n", *p, n);
    
    changeValue(&p);
    
    printf("%d %d\n", *p, n);
}



/*
run:

15 15
700 700

*/

 



answered Jun 19, 2024 by avibootz

Related questions

1 answer 185 views
1 answer 169 views
1 answer 226 views
1 answer 255 views
1 answer 246 views
1 answer 219 views
...