c++

Dissection based learning for C++

Which are the best dissection based learning books for C++? I found that Ira Pohl's C++ by Dissection is good. Are there any other good ones like these. Thanks ...

Using a C++ library in an Objective-C app?

I am planning on learning Objective-C to write an OS X application but it will depend on a library written in C++. Can C++ be used in an Objective-C app? Bear with me, I'm new to desktop development. The C++ library will be used simply to analyze a file and return some data about that file. For example, in the libraries compiled example...

Simple registration key system for software distribution.

I have a small VC++ project that I would like to market. Can anyone point me in the right direction in terms of writing a "serial key" system. I have no idea how these things are implemented. ...

What creates the three close/minimize/maximize icons in the top corner of a window? (C++)

I am making a C++/Windows/DirectX program, and when it runs in windowed mode (using d3dpp.Windowed = (!FULLSCREEN); where FULLSCREEN is defined as 0), the three icons that are usually at the top of any window (minimize, maximize/restore, and close) are not there. Also, it's not like just an image with no border or anything, it looks ...

Can you make custom operators in C++?

Is it possible to make a custom operator so you can do things like this? if ("Hello, world!" contains "Hello") ... Note: this is a separate question from "Is it a good idea to..." ;) ...

How to remove "NSBundle may not respond to '-pathForResource:ofType' " warning.

I am trying to expose the pathForResource functionality to C++ from objective-c. However, I am very new to objective-c and have not been able to discern how to use a c string as an argument in objective-c. clearly I have the wrong idea here. how do i get pathForResource to use c strings as an argument? here is my function: static...

Global Constants vs. Enumeration

In terms of coding practice, in what contexts are global constants preferred to enumeration and vice versa? For example, let's say I needed a way to express a variety of tile sprites at a global scope. I could do... const int TILE_RED = 0; const int TILE_GREEN = 1; const int TILE_BLUE = 2; const int TILE_CENTER = 3; const int TILE...

Objects and Operator Overloading C++

class object_1 { public: ... friend ofstream& operator<<(ofstream &out, const object_1 &obj_1); friend object_2; private: char *pCh_mem1; char *pCh_mem2; int *pInt_mem1; int *pInt_mem2; }; class object_2 { public: ... friend ofstream& operator<<(ofstream &out, const object_2 &obj_2); friend object_1; }; Object1'...

How to find performance bottlenecks in C++ code

I have a server application written in C++ and deployed in Cent OS. I haven't wrote any part of its code but i need to optimize its performance. Its current performance is acceptable for few amount of users but when the number of users increase the server's performance decrease dramatically. Are there any tools, techniques or best pract...

Getting the point of a catmull rom spline after a certain distance?

If I have a Catmull-Rom spline of a certain length how can I calculate its position at a certain distance? Typically to calculate the point in a catmull rom spline you input a value between 0 and 1 to get its position via proportions, how can I do this for distances? For example if my spline is 30 units long how can I get its position at...

Does C++ have an equivilent to Python's __setitem__

Just as the title asks, does C++ have the equivalent of Python's setitem and getitem for classes? Basically it allows you to do something like the following. MyClass anObject; anObject[0] = 1; anObject[1] = "foo"; ...

Getting Connection timeout in OCCI

Hi All, I need to test the connectivity if the Oracle::OCCI::Connection, and how can i get and set the connection timeout value? i read the documentation of Oracle OCCI but i can't find the required functions. Thanks in Advance. ...

if given a 15 digit number whats the best way to find the next palindrome?

in c++ what will be the fastest logic to find next palindrome of a given 15 digit number? for example what will be the next palindrome of: 134567329807541 ? ...

typedef vs public inheritance in c++ meta-programming

Hi, Disclaimer: the question is completely different from Inheritance instead of typedef and I could not find any similar question so far I like to play with c++ template meta-programming (at home mostly, I sometimes introduce it lightly at work but I don't want to the program to become only readable to anyone who did not bother learni...

Xcode Documentation Set for C++ Standard Library

I've recently began using C++ with XCode and I'm starting to miss the integrated documentation that is available for Objective-C. I know that there is a way to generate documentation sets using Doxygen, but a readily available bundle would certainly be preferable... Is there an easy way to get XCode to search at least the standard C++ ...

Confusion in output

Consider the following program. #include<iostream> using namespace std; class base { public: int _bval; base():_bval(0){} }; class derived:public base { public: int _dval; derived():base(),_dval(1){} }; int main() { derived d[5]; base *p; p=d; for(int i=0;i<5;++i,++p) cout<<p->...

How to resolve host (only) using Boost.Asio?

According to the documentation of boost::asio::ip::tcp::resolver::query in order to resolve host it should receive service as well. What if I want to resolve host without relation to port? How should I do it at all? Should I specify dummy port? ...

Registry - How to rename key in registry using C++ ?

How to rename key in registry using C++? I want rename key "Myapp\Version1" to "Myapp\Version2". I don't see any function in MSDN about renaming keys in registry. ...

Multiple inheritance dilemma in C++

Hi all, I'm facing problems with the design of a C++ library of mine. It is a library for reading streams that support a feature I haven't found on other "stream" implementations. It is not really important why I've decided to start writing it. The point is I have a stream class that provides two important behaviours through multiple in...

Is it possible?(c++)

Write pointer to string,delete pointer,and load pointer from string? ...