Solved

change to Pointer and new value

Posted on 2014-02-14
3
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Arduino EDI - Programming language 3 128
Header of docx file 17 145
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 60
Fill Null values 5 56
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

752 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