473,480 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

pointer and address

what does T*& oldmem means..?

Apr 2 '07 #1
5 1233
On 2 Apr., 13:29, "yashwant pinge" <yashwantpi...@gmail.comwrote:
what does T*& oldmem means..?
Read from right to left: oldmem is a reference to a pointer to T. I
believe this one must be in the faq (if you don't have it, google for C
++ faq).

/Peter

Apr 2 '07 #2
* yashwant pinge:
what does T*& oldmem means..?
It could be a valid function argument.

If it is, then oldmem is a reference to a pointer to T.

Include more context if you want more than such speculation.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Apr 2 '07 #3
On Apr 2, 1:35 pm, "Alf P. Steinbach" <a...@start.nowrote:
* yashwant pinge:
what does T*& oldmem means..?
It could be a valid function argument.
Or a function return type, or a class member declaration, or a
local or global variable definition, or...
If it is, then oldmem is a reference to a pointer to T.
Include more context if you want more than such speculation.
It's true that if oldmem is a variable whose type overloads
operator& to return e.g. an int, and T is also a variable of
type int, the meaning changes. If the operators in the
expression aren't overloaded, however, I don't see what else it
could mean.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 3 '07 #4
* James Kanze:
On Apr 2, 1:35 pm, "Alf P. Steinbach" <a...@start.nowrote:
>* yashwant pinge:
>>what does T*& oldmem means..?
>It could be a valid function argument.

Or a function return type, or a class member declaration, or a
local or global variable definition, or...
>If it is, then oldmem is a reference to a pointer to T.
>Include more context if you want more than such speculation.

It's true that if oldmem is a variable whose type overloads
operator& to return e.g. an int, and T is also a variable of
type int, the meaning changes. If the operators in the
expression aren't overloaded, however, I don't see what else it
could mean.
I don't remember my thinking, but one situation when the meaning can
potentially change is, as you note, when it's an expression.

Also, consider "T*& oldmem() { ... }" ;-).

I think I just put in that about context because it's generally good
advice and the poster seemed to be unaware of the need for context.

--
You really should have this fixed.

Just to try it out I'm posting from Google groups.

If may signature delimiter is correct, then it should be possible for
anyone.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Apr 3 '07 #5
* alfps:
>
Just to try it out I'm posting from Google groups.

If may signature delimiter is correct, then it should be possible for
anyone.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Dang! Google, you bad bad dog! Sit! Sit!

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Apr 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2034
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << "...
110
9805
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
3
2325
by: Bruno van Dooren | last post by:
Hi All, i have some (3) different weird pointer problems that have me stumped. i suspect that the compiler behavior is correct because gcc shows the same results. ...
52
5584
by: Douglas Garstang | last post by:
I can't believe I've been trying to work this out for hours now, and I can't believe I couldn't find someone asking for a similar solution in the newsgroups. No wonder I hate C so much, and every...
204
12880
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
23
7758
by: bluejack | last post by:
Ahoy... before I go off scouring particular platforms for specialized answers, I thought I would see if there is a portable C answer to this question: I want a function pointer that, when...
51
4389
by: Kuku | last post by:
What is the difference between a reference and a pointer?
73
3749
by: Markus | last post by:
Hi, I can't understand why this code causes a "memory read exception" at int x=**a; void pass(int** a) { int x=**a; } void main()
9
2997
by: junky_fellow | last post by:
Hi, To print the pointer using printf(), we convert it to (void *) . printf("%p",(void *)ptr); My question is how printf() determine which type of pointer is passed to it and prints its value...
4
1443
by: jthep | last post by:
If I have a pointer say int **pa that stores the address to another pointer int *pb, pa would be storing the address of pb which contains an address to lets say int c = 10. Picking an arbitrary...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
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
7044
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,...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4779
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.