## Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

• Help others & share knowledge
• Earn cash & points
Solved

# Pointers

Posted on 1998-10-06
191 Views
variable type a;

What should be the variable type(say,int/char/char* etc.)so that,
a = &a =*a = same output/result?.
That is,what should be then the variablke type of a.
0
Question by:tmmet
• 2

LVL 1

Expert Comment

ID: 1174604
is this a riddle?
0

LVL 1

Accepted Solution

Booth882 earned 0 total points
ID: 1174605
there is no general type that would accomplish this.

but if you have an int that contains a hexidecimal value equal to its address this would be true.

int AnInteger;

AnInteger = &AnInteger;

if you did this then your statement

AnInteger  ==  &AnInteger  ==  *AnInteger.

would be true.
0

LVL 84

Expert Comment

ID: 1174606
a(){
printf("%d %d %d\n",a==*a,a==&a,&a==*a);
}

0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.