Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C pointer on a pointer : unused variable

Tags:

c

pointers

I was just doing my first app in C and i have this warning (edited) : unused variable pp

int compteur =  1;
int *p = &compteur;
int **pp = &p;

I was just trying to make pp pointing on the adress of the variable p

Forgive me if that's a stupid question, but in my book they don't talk about pointers on pointer. Thanks

like image 875
sf_tristanb Avatar asked Aug 08 '26 23:08

sf_tristanb


1 Answers

That's perfectly legitimate. Your compiler is just informing you that you made a variable, then didn't do anything with it - normally indicating a programming error.

like image 104
Puppy Avatar answered Aug 10 '26 14:08

Puppy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!