change to Pointer and new value

Hello,
inside a function I have the value:

utils::CSecurityKey aesExmapleKey ( std::vector< char > (1) );

I want to move this now to the header to use this value global inside the class. So I added:

utils::CSecurityKey *aesExmapleKey;

to the header. what do I have to add to the cpp file for initialize?

aesExmapleKey = new.....?

Thanks for help,

Ingo
Ingo FoersterOwner, CTOAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jkrConnect With a Mentor Commented:
From what you described, that should be

aesExmapleKey = new utils::CSecurityKey(std::vector< char > (1));

Open in new window

0
 
jkrCommented:
BTW, don't forget to

delete aesExmapleKey;

Open in new window


when you no longer need it. Otherwise, you'd leave a memory leak.
0
 
Ingo FoersterOwner, CTOAuthor Commented:
Great, many thanks!
0
All Courses

From novice to tech pro — start learning today.