Discussion:
[omniORB] [C++] memory allocation
Hung Ta Viet
2011-01-25 14:59:06 UTC
Permalink
Hi omniORB friends,

You're the experts of omniORB, I think you're expert in C++, also.

I have a question, who knows is very welcome:

Assume we have a fragment of code:

typedef char String [46];
String* pStr = new String[10];

A question are:
1. How is memory allocated for the pointer pStr?
2. If we use delete pStr; , is the memory allocated for the pointer deleted
completely?

Regards,
Hung




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20110125/5be0e1d2/attachment.htm
Martin B.
2011-01-25 21:59:50 UTC
Permalink
Post by Hung Ta Viet
Hi omniORB friends,
You're the experts of omniORB, I think you're expert in C++, also.
typedef char String [46];
String* pStr = new String[10];
1. How is memory allocated for the pointer pStr?
2. If we use delete pStr; , is the memory allocated for the pointer
deleted completely?
For general C++ questions let me recommend the following resources:

C++ FAQ Lite - http://www.parashift.com/c++-faq-lite/

nntp - comp.lang.c++
http://groups.google.com/group/comp.lang.c++/topics

nntp - comp.lang.c++.moderated
http://groups.google.com/group/comp.lang.c++.moderated/topics

cheers,
Martin

Loading...