Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

how to assign address of int variable to an entry in array of pointers

$
0
0
Hi,

Why would this not work? And what is the right thing to do.
        int x,y,z;

	printf("Enter three integers: ");
	scanf("%d %d %d",&x,&y,&z);
        
	p[0]=&x; //syntax error here
	p[1]=&y; //and here
	p[2]=&z; //and here



Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>