Description:
The object-oriented C++ language.
|
|
|
Pointers and Delete Operator
|
| |
I know that when I allocate memory dinamically I must release it using the delete operator. But when I don't use the new operator do I must release the memory pointed by a pointer? For example: int main(){ int age = 10; int *agePtr = &age; addAge(agePtr); //do something more... //so if i do not need agePtr at all should I code the following?... more »
|
|
How to make IntelliSense work with WTL 8 classes
|
| |
Hi all, My IntelliSense in VS2005 hasn't been working with WTL 8 classes. The project compiles fine but whenever I type SomeWTLClass. or SomeWTLClass-> it does not work. The status bar changes to: IntelliSense: 'Type of expression to the left of . or -> is not class, struct, or union' (see 'Troubleshooting Intellisense in C++ Projects'... more »
|
|
Use Inline in class?
|
| |
I want to know if the practice is the best. Do I need to place inline keyword inside class definition or outside member function definition. For example class A { public: A(); ~A(); inline void Test(); // should place inline here? ...inline void A::Test() // should place inline here?... more »
|
|
Comparing an element with a set
|
| |
Hello, I have a two sets OLDLIST and REMOVE. I would like to remove every element in OLDLIST if it is also occuring in REMOVE and store the remaining elements from OLDLIST into NEWLIST. So far, I have read in both lists but I'm struggling comparing the elements - I have something like double oldlist[oldsize];... more »
|
|
Installing Visual Studio 2008, VC++ 9
|
| |
Installing VC9 took me about 16 hours, fully engaged. Initially it was all: type in the product key, try something different, watch it crash .. repeat. After surfing the “ inter webs ”, I knew to unZip WebDesignerCore.EXE, so that that part of the install wouldn't just fail silently. From there, I ( rightly ) decided I to uninstall Office 2007.... more »
|
|
Use Function Pointer Instead Friend?
|
| |
I design a class for general purpose. I do not allow a client to read or modify interface and implemention. I allow them to write a new non- member function outside of class' interface and implmention. The problem is that non-member function cannot access private data member. The friend keyword is not the solution. I am aware that friend... more »
|
|
Sandbox server
|
| |
How would one program a sandbox? Let's say the server and all clients have the same architecture, and environment (for example 32bit x86-Linux environment). The server shall offer sandbox services to clients. A remote client can get a sandbox (an empty directory space) on the server, upload his precompiled executable program,... more »
|
|
Why people use "new" & "delete" too much?!!
|
| |
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at the end of the app for example: class test { public: int x; ...int main(int argc, char **argv) {... more »
|
|
peek inside container's elements from UnaryPredicate
|
| |
Hello, Suppose I have a container of pair<int, int>, how would I use the predefined function objects/adapters (e.g., greater, bind1st, mem_func, compose_f_gx) and the "count" function from <algorithm> to get and number of pairs, "p", that have "p.first > 5"? Writing a custom UnaryPredicate function is easy, but I would... more »
|
|
|