Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
0 like 0 dislike

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-


Course Name



Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence || Labeled as Highest Rated Course by Udemy

Apply Coupon


Complete Machine Learning & Data Science with Python| ML A-Z Apply Coupon


Complete Python Programming from scratch | Python Projects Apply Coupon
    More Courses

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.1k points)
edited by
Best answer

Print Address of Character and String Using Pointers

In this program we are going to print address of character and string using pointers. As we know a string is a stream of characters and each character holds different address. So to print address of each character's address we are going to take a pointer array to hold address of each character as in the following example.

Example :

void main()

//Declaration and initialization of character and string
char str[30]="Goeduhub Technologies";
char c='A';
int i;
//Declaration and assignment of pointers
char *ptr_str[30];
char *ptr_c=&c;

//Assigning address of each character of string to pointer array

//Printing value and address of variables on output window
printf("\nString Entered is : %s\n Address of string :",str);
printf("\n%c's address : %p",str[i],ptr_str[i]);
printf("\nValue of c = %c\nAddress of c = %p",c,ptr_c);

Output :

Output of above program showing address of string using pointer

For More GTU C Programming Lab Experiments Click Here

3.3k questions

7.1k answers


4.6k users

Related questions


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |