471,110 Members | 1,072 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,110 software developers and data experts.

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 1101
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.