468,720 Members | 1,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

can't able to get output in pointer

rampraveen
#include"main.h"
void main()
{
char *address;
char ch='a';
address=&ch;
clrscr();
printf("\nvalue of ch-->%c",address);
getch();
}
i am not able to get output..will you tell which place i have to change...if i compile there is no error is coming....will you give correct program..please.......
May 8 '10 #1

✓ answered by Dheeraj Joshi

What you want to print? This code compiles but gives some junk result.
If you want to pint "a" as output change your code to
Expand|Select|Wrap|Line Numbers
  1. printf("\nvalue of ch-->%c",*address);
  2.  
Regards
Dheeraj Joshi

2 1064
Dheeraj Joshi
1,123 Expert 1GB
What you want to print? This code compiles but gives some junk result.
If you want to pint "a" as output change your code to
Expand|Select|Wrap|Line Numbers
  1. printf("\nvalue of ch-->%c",*address);
  2.  
Regards
Dheeraj Joshi
May 8 '10 #2
@dheerajjoshim
very thanks......
May 8 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by asimorio | last post: by
1 post views Thread by Me | last post: by
rampraveen
6 posts views Thread by rampraveen | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.