diff --git a/saj006 b/saj006 new file mode 100644 index 0000000..0b43c6a --- /dev/null +++ b/saj006 @@ -0,0 +1,28 @@ +#include + +int main() +{ + //char variable + char ch; + + //char pointer + char *pCh; + + /* Initializing pointer variable with the + * address of variable ch + */ + pCh = &ch; + + //Assigning value to the variable ch + ch = 'A'; + + //access value and address of ch using variable ch + printf("Value of ch: %c\n",ch); + printf("Address of ch: %p\n",&ch); + + //access value and address of ch using pointer variable pCh + printf("Value of ch: %c\n",*pCh); + printf("Address of ch: %p",pCh); + + return 0; +}