473,545 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pointer and address

what does T*& oldmem means..?

Apr 2 '07 #1
5 1235
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.now rote:
* 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 objektorientier ter Datenverarbeitu ng
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.now rote:
>* 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
2041
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 << " and &s = " << &s << "\n";
110
9814
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 must be an object instead of
3
2334
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. ---------------------------------------------- //example 1: typedef int t_Array; int main(int argc, char* argv)
52
5601
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 time I get the textbooks out end up throwing them against the wall in rage. Thats been going on for 10 years now. Anyway, I have: typedef...
204
12927
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 = {0,1,2,4,9};
23
7777
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 called, can be a genuine no-op. Consider: typedef int(*polymorphic_func)(int param);
51
4409
by: Kuku | last post by:
What is the difference between a reference and a pointer?
73
3767
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
3004
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 accordingly ? I have this doubt as different pointers may have different representation and different size. So, how does printf determine
4
1451
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 address for pb to be 5009 and c to be 2331. Can someone verify for me if I have the following values correct: pa = 5009 pb = 2331 *pb = 10 would...
0
7682
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7449
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6009
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3479
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1911
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 we have to send another system
0
734
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.