How to return a pointer, to another window?
If i just return, for example
return Pointer_name;
Then change something in another window,it doesn't affect the orginal one, when i change anything, it seams like another copy.
How to return a pointer, to another window?
If i just return, for example
return Pointer_name;
Then change something in another window,it doesn't affect the orginal one, when i change anything, it seams like another copy.
You need to provide some more information. A single line of code with no context at all doesn't give us anything to go on.
Please post some code that shows what you are trying to do, especially the code that returns the pointer, and where you are trying to use the pointer and "it doesn't affect the original one".
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Ther is nothing to show. I wanna return one pointer, to another window thats it.
So for example Window_A_PTR in a part of MainWindow.
I wanna return and use that pointer to Window_B.
So:
Window_A* Window_A::Return_Pointer()
{
return Window_A_PTR;
}
Now in window B:
//Wher i wanna use it
{
Window_A* Temp = new Window_A;
Window_A Get_The_Pointer;
Get_The_Pointer = Temp->Return_Pointer();
//Then use that "Get_The_Pointer" and do some changes in Window_B, but it should affect Window_A_PTR, cuz it's the orginal one.
}
Why are you breaking your English?
If you want to be taken seriously use proper language.
Your pseudo code does what you want in terms of returning the pointer.
The problem you have is therefore not clear.
Its seems to me your last comment may be pointing to the problem which may be the scope of usage.
To be sure however the real code where you use the pointer getter method is needed.
Show the place in code that doe NOT behave like you intend it to maybe this will brings us to the right path.
And please use code tags when posting code.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks