473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 1231
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

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

Similar topics

2
by: Tom | last post by:
I have some virtual member functions like this: struct IBlah { virtual void f1() = 0; virtual void f2() = 0; } I want to get a run-time identifier for one of these functions that I can...
1
by: ypjofficial | last post by:
Dear All, According to OOPs , a base class pointer can to point to derived class object....call this as fact1 But somehow I am not comfortable while understanding this concept. The explanaition...
8
by: G Patel | last post by:
Hi, As the FAQ and several clc post warn again, I know it's not legal to use a pointer to step outside the bounds of an array (except one past the last element, and that pointer must never be...
3
by: ferbar | last post by:
Hello all, This may sound pretty basic stuff.. but I'm working on a socket example whose client seems to work fine, but the server doesn't send to the client the expected result. The problem is...
11
by: asimorio | last post by:
Hi all, If I don't new up a pointer, can I delete it? see code below: void A::foo() { char* buffer; delete buffer; return; }
1
by: Me | last post by:
Hey, First, what i have is a form and a few panels. my code: if(Partytent->Panel5x5a->Left+Partytent->Panel5x5a->Width >= Partytent->Panel5x5b->Left-2 && Partytent->Panel5x5a->Top >=...
6
by: kareemaffan | last post by:
Hello Everyone I want to insert values into MS Access database through VB.NET in Visual Studio 2005 . I have used the following code which is not working. Private Sub Button2_Click(ByVal sender...
3
shrek123
by: shrek123 | last post by:
How can I pass output of some perl subroutine to a subroutine? I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine. I tried this; ...
6
visualbasic1111
by: visualbasic1111 | last post by:
Hi All, I want to know whether how how many time a pointer can point to another pointer, in the way P1->P2->P3->P4.................. up to where this link can proceed ans is valid in C or C++
6
rampraveen
by: rampraveen | last post by:
#include"main.h" int i; int sum=0; void main() { char choice; printf("enter E-->even O-->odd"); choice=getch(); choice=toupper(choice); if(choice=='E')
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.