Solved

change to Pointer and new value

Posted on 2014-02-14
3
334 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

760 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

18 Experts available now in Live!

Get 1:1 Help Now