please give a simple program for learning "char*".....thanks
shahzeb C
0
Newbie Poster
Recommended Answers
Jump to Post#include <stdio.h> void main(void) { char ch = 'a'; //defining a character char *charpointer = &ch; //assigning char"a" to charpointer printf("\n [%c]", *charpointer); }
Output
[a]
Here charpointer stores the address of "a"
*charpointer means value of variable stored whose address is stored in charpointer
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.