Yes you did :).. came very close
Shiv
Type: Posts; User: shiv_tech_quest
Yes you did :).. came very close
Shiv
Read what the God Of C++ (Stroustrup) had to say:
int main()
{
X ob;
X *prt = &ob;
No. You get the address from "this"; that doesn't involve a call of
You don't get any output when you do temp = this because you are assigning a pointer's value into another. Only when an explicit use of & is done w.r.t an object, its operator&() gets called.
shiv
Hmmmm I would like to exhaust all options before disturbing THE MAN.... Stroustrup ofcourse...
I am also referring to his book apart from Thinking in C++ etc and could not find any clear info, that...
How can it take the address without the use of & operator on itself???
Shiv
Thanks for understanding my question correctly Tonto.
I just can't sleep in peace without understanding how this is working.
Shiv
Hi Maxhavoc,
I know that it can be overloaded and I know it works.
Only few operators cannot be overloaded (. , .*, ::, ?:, sizeof) and the address-of operator is not one among them. The above...
Hi Folks,
Why doesn't overloading the Address-Of Operator result in a recursion???
class X {
public:
X* operator&() // Compiler internally should convert it as X*...
Hi Guys,
Recollected the concept. Here's the solution
Instead of coding
void A::hello(int) // in class B,
I should have typed
using A::hello;
regards,
Hi Folks,
My understanding is that to overload functions across class, the base class's function must be declared in the derived class and then it would allow me to overload a function. But the...
#include <iostream>
using namespace std;
class X
{
public:
X(){}
virtual void f1()
{
Hi Folks,
I did read the UNIX man pages for altzone and timezone, but ain't understanding their actual use.
Can any one out here provide a brief case-study(example) w.r.t their use???
would...
Hi,
I have written this program and i tested it and it very much works...
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("The path of the command is : %s\n", argv[0]);
Hi
At the end of your program .. simply display this message
int main()
{
......... your program....
printf("Exiting the program.... press the enter key");
Hi Folks,
I did read the UNIX man pages for altzone and timezone, but ain't understanding their actual use.
Can any one out here provide a brief case-study(example) w.r.t their use???
would...
Hi Folks,
Is this datatype included in the Standards.
If yes,
1) what is the size of a long long int
2) What would be its format specifier w.r.t printf / scanf
Thanks in advance
The information you provided was very helpful....
Hi Guys,
I need to have a tightly packed structure. I believe I need to use pragma packed to achieve the same.
How do I go about using it and what are the related env variables I need to...
Thanks for those functions.... but I am working on Sun Solaris... and no such functions exist..... :(
So I am still at SQUARE ONE :(
Hi Guys,
I am still waiting to see a solution.. in here...
Solution
int main()
{
double num;
cout << "Enter a value " ;
cin >> num;
cout << "The square root of : " << num << " is " <<
I have a directory in which there could be huge list of files. But only few files in that directory would have a specific text "_tmp_" as part of their filename.
I have written a block of code...
Hi Folks,
How do I check for the existance of files with a common pattern in any specific directory.
For eg:
list of filenames
x_tmp_y;
y-tmp_z;
....
Hi, I had posted this question, and having said that, I have also answered the question after some R & D. So do take time to read the second post that I have posted. That must work.
Well in...
This works
If the operator requires an lvalue as their left-hand operand, then its got to be a member function. If its got to work on both the way, it must be a non-member function.
class X...