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,695 questions

57,003 answers

573 users

How to use pointer to int array in C

1 Answer

0 votes
#include <stdio.h>
 
#define LEN 10
 
int main() 
{ 
	int arr[10] = {5, 7, 2, 5, 9, 1, 0, 7, 8, 6};
	int *p = arr;
   
	printf("%p\n", p);
	printf("%p\n", arr);

	p[0] = 99;
	for (int i = 0; i < LEN; i++)
        printf("%2i", p[i]);

	return 0; 
}
 
 
 
/*
run:
 
000000000062FE10
000000000062FE10
99 7 2 5 9 1 0 7 8 6

*/

 



answered Apr 6, 2019 by avibootz
edited Jul 26, 2019 by avibootz

Related questions

1 answer 301 views
1 answer 255 views
1 answer 300 views
300 views asked Aug 23, 2016 by avibootz
1 answer 265 views
265 views asked Oct 6, 2019 by avibootz
1 answer 256 views
...