c++

Incompatibilities between compiled Visual Studio 2008 C++ project in Windows Vista running on XP

Has anyone experienced incompatibilities with a C++ project executable compiled with Visual Studio 2008 C++ on Windows Vista when the executable is run on Windows XP? I'm having difficulties on such issue. ...

Convert const char* string to NSString with length AND encoding

I wonder which method would be better to convert const char* string to NSString. I found there are some facts. [NSString stringWithCString:length:] is kind of deprecated. [NSString stringWithCString:encoding] may be used for my purpose But I want to convert with length AND encoding(because I want to make that fine if I have some Non-...

what is auto_ptr_ref, what it achieves and how it achieves it

auto_ptr_ref documentation here says this This is an instrumental class to allow certain conversions that allow auto_ptr objects to be passed to and returned from functions. Can somebody explain how auto_ptr_ref helps in achieving this. I just want to understand the auto_ptr class and its internals ...

Why does using boost increase file size so much?

I've noticed that when I use a boost feature the app size tends to increase by about .1 - .3 MB. This may not seem like much, but compared to using other external libraries it is (for me at least). Why is this? ...

need help on implement a feature similiar to WScript.ConnectObject

I am working on adding scripting capability to my application. I have largely solved all the issues. Now I can expose my objects to scripts, and the script can handle events from my objects as well. As a step further I wish that the script is able to handle events fired from third party objects, in a way similar to WScript.ConnectObject....

Does this program show the four card suits (♠♣♥♦) on all standard-ish systems?

The following shows ♠♣♥♦ on windows xp, will it for all systems?? #include <stdio.h> int main(int argc, char *argv[]) { for (int i = 3; i <= 6; ++i) printf("%c", (char)i); getchar(); return 0; } ...

What is the relationship of .lib and .obj to each other and my project in c++?

What are how do .lib and .obj files relate to each other? What is their purpose? Is a .lib just a collection of .obj files? If so are the .obj's then stored inside the .lib making the .obj's unnecessary? ...

C++ Manipulator

what is manipulator? in C++ define varios types of manipulator............. ...

How I print UTF-8 characters C++?

How I print these UTF-8 characters in C++? ...

First time ever creating a Terrain

First night at taking a look at different ways to create Terrain. I'm wanting to work on a racing project and was wondering if there was a way to create a 3D race track some how. We plan on using C++, and are also using PhysX and openGL. Where should I be looking for creating Terrain? Also, does anyone know of some good Tutorials/Tips ...

Are function-local typedefs visible inside C++0x lambdas?

Sorry to bump with a side-question, but although the bug reports indicate them as fixed I still cannot get any of the code to work, crash and all. Have I installed the final release incorrectly or are they still not publicly fixed? :( I've run into a strange problem. The following simplified code reproduces the problem in MSVC 2010 Be...

C++ type traits to check if class has operator/member

hi Is it possible to use boost type traits or some other mechanism to check if a particular template parameter has an operator/function, e.g. std::vector as a template parameter has operator[], while std::pair does not. ...

error LNK2019: unresolved external symbol

Ok, so I'm having a problem trying figure out the problem in my code. I have a lot of code so I'm only going to post the relevant parts that are messing up when I compile. I have the following function inside of a class and it will compile and everything will run fine until I call the function "CalculateProbabilityResults" and it runs th...

How do I install g++ on MacOS X?

I want to compile C++ code on MacOS X, using the g++ compiler. How do I install it? ...

How to create a hidden window in C++

How to create a hidden window ? The purpose of this window is to receive some messages. ...

Access a value from a struct via a pointer? (C++)

Here is my struct: struct Checker { short row; short col; unsigned short number; short color; }; Now, I have to also make another struct to represent a checkers board: struct Board { Checker checkers[2][13]; // Zeroth entry of 13 is not used. Checker *grid[8][8]; // each entry holds Null or an address ...

SIMD or not SIMD - cross platform

I need some idea how to write a C++ cross platform implementation of a few parallelizable problems in a way so I can take advantage of SIMD (SSE, SPU, etc) if available. As well as I want to be able at run time to switch between SIMD and not SIMD. How would you suggest me to approach this problem? (Of course I don't want to implement th...

load .model file in C++

I am working on a opengl project in C++. I need to write a loader to input features from a .model file. It seems fstream can not handle that. Any comment or advice? Thanks. ...

Lifetime of a thrown object caught by reference

The C++ Standard, paragraph 15.1.4 sais: The memory for the temporary copy of the exception being thrown is allocated in an unspecified way, except as noted in 3.7.3.1. The temporary persists as long as there is a handler being executed for that exception. I'm wondering why this code crashes (I know that it's not best practice): c...

Generating a unique id of std::string.

I want to generate any limited std::string size unique id (i.e of size 6) in 32 bit application. what would be the best and quick way to do this? ...