what does T*& oldmem means..? 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
* 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?
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
* 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?
* 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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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";
|
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
|
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)
|
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...
|
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};
| |
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);
|
by: Kuku |
last post by:
What is the difference between a reference and a pointer?
|
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()
|
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
|
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...
|
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. ...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
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...
| |