Solved

change to Pointer and new value

Posted on 2014-02-14
3
337 Views
Last Modified: 2014-02-15
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
Comment
Question by:Ingo Foerster
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 280 total points
ID: 39860625
From what you described, that should be

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

Open in new window

0
 
LVL 86

Expert Comment

by:jkr
ID: 39860628
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
 

Author Closing Comment

by:Ingo Foerster
ID: 39861337
Great, many thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ get user from AD  (VS6) 7 55
C language IDE – Compilers installation 14 68
Exception thrown at 0x00007FFD5BC81F28 7 38
FMX TCameraComponent Problem 2 54
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now