Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

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
0
Ingo Foerster
Asked:
Ingo Foerster
  • 2
1 Solution
 
jkrCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now