How to fix error C2582: Operator = function is unavailable

Hey,
I am copying one pointer to another pointer and am getting error C2582: operator =' function is unavailable in 'CBaseInitBlock2.Below is my code:
1
2
3
4
5

CBaseInitBlock2 *pInitBlock2New = pNewInitBlock2;
CBaseInitBlock2 *pInitBlock2Saved = pSavedInitBlock2;
*pInitBlock2New = *pInitBlock2Saved; 


I have no clue on how to fix this error any advice would be greatly appreciated!!!

Thanks In Advance
Presumably, this means that the assignment operator for CBaseInitBlock2 has been made protected or private.

Can you confirm that it's the third of those three lines that's generating the error?

Last edited on
MikeyBoy,
I commented everything out of that method and just left those three lines and still received that error. What do I need to look for to male the assignment operator for CBaseInitBlock2 public?
I commented everything out of that method and just left those three lines and still received that error.

I'm asking you to confirm which of those 3 lines it is that's causing the error, since you haven't seen fit to share the line number in the error message with the rest of us.

What do I need to look for to male the assignment operator for CBaseInitBlock2 public?

Well, the first step would be to look at the header file that defines the CBaseInitBlock2 class, to see if the assignment operator is declared and, if so, with which access specifier.
Topic archived. No new replies allowed.