After reading the article "Back to Basics" by Mr.Spolsky I have thought about string structure in C, that converges most of advantages of Pascal-style string (with length byte) and classic ASCIIZ-strings in C and reduces most of their disadvantages. The main demand is to make this new string effective in machine commands. (for this task ...
I create new c/c++ project in Netbeans and change Makefile and add -lpthread for work with pthread and run my project .also I need to add some runtime argument from project properties/Run/Arguments . when I change runtime Arguments Makefiles that place at /'project folder'/nbproject/private/Makefile-Debug.mk & Makefile-Release.mk are re ...
What does this mean in C++:
#define TheVLM(x) VLM::Global()->x TheVLM(Run());
...
What is the most efficient way to count all the different keys in a hash_multimap?
E.g. if I have a already filled hash_multimap, (e.g. a container where you can store multiple entities with a same key)
how can i retrieve the set of keys?
...
I am thinking about my final year project and the possibility of supporting multiple languages, e.g. English, Welsh, German etc..
Is there a standard way of supporting multiple human languages in a program?
What is the recommended file format for storing the different languages?
It is something I am clueless on but is obviously a very ...
Please suggest me the best way to use .NET dll in VC++ project.
...
I maintain a large C++ application using Win32 and i want to use some of the new controls introduced in Vista/Windows 7 (New ballon help, command links, status bar notofications.
I have downloaded the Windows User Experience Interaction Guidelines, but i dont find a corresponding API Reference. I know that some of these controls will b...
Sphere() : theRadius(1.0)
{
}
Why is it preferable to have a constructor written with initializers (above) than a constructor that initializes the data members within its body (below)?
Sphere()
{
theRadius = 1.0;
}
...
I want to create a factory for creation of objects implementing an abstract interface, which would return a reference to the object that is kept internally, and objects are not replicated. The idea is pretty much the same as in the log4cxx/log4j Logger class design. I would also like to hide as much details from the client as possible, i...
I am maintaining an application which tries to help the user get his parameters to work together, as there are many interdependencies.
Now there is a default value of x for a variable Y. When the user changes some other variable Z, there might be a new minimum value for Y which is greater than x. This is set as a minimum for the spinbo...
I'm working on a very basic game and I have a std::list collection of objects that pertain to my game. I declared it as:
std::list<Target> targets;
When I iterate over it, using
for (std::list<Target>::iterator iter = targets.begin(); iter != targets.end(); iter++) {
Target t = *iter;
t.move();
}
My objects are...
Can the Waf build system generate Visual Studio project files for C/C++?
...
Hi everyone, I learn C++ for a while and still didn't come across good book which would explain what are those beasts? Are they integral C++ feature? If so how is it that they are only mentioned in such book like The C++ Programming Language by B.S. If not, where can you get reliable information about them - prefferably a book (don't rea...
Is it possible to make this work?
template<class T>
fun(T * t) { t->someMemberFunc(); }
... somewhere in the code:
ManagedType ^ managedP = gcnew ManagedType();
UnmanagedType * unmanagedP = new UnmanagedType();
fun(managedP);
...
I'm currently able to set a listview style VIA the ListView_SetExtendedListViewStyle method, however this makes all columns have the same style. My goal is to only modify one column (to basically have the LVS_EX_UNDERLINEHOT|LVS_EX_UNDERLINECOLD|LVS_EX_TWOCLICKACTIVATE style).
Is there a way to modify the style of only one column and no...
We're trying implement a .NET Service Object that supports a COM interface to emulate a POSPrinter but still be compatible with the older technologies.
We have our interface and class object in the following class..
using [...]
namespace yRPOSPrinterDotNet
{
[Guid("2D570F11-4BD8-40e7-BF14-38772063AAF0")]
[InterfaceType(ComIn...
I have a vector, defined by std::vector<LPDIRECT3DTEXTURE9> textures; Later, I am passing a LPDIRECT3DTEXTURE9 object to it, like so textures.push_back(texture); Here is a sample of this:
void SpriteManager::AddSprite(float x, float y, float z, LPDIRECT3DTEXTURE9 texture)
{
//snip
textures.push_back(texture);
//snip
}
Th...
Hi,
I have a very silly problem with the code shown below.
The goal is to increment multiple counters at once, and have their value printed after being processed by a provided functor.
However g++ complains :
test.hpp:32: error: expected `;' before 'it' "
I tried to add some typedef, but the error message remains. Here is the code (...
Hello!
I have run into trouble trying to implement functionality for serializing some classes in my game. I store some data in a raw text file and I want to be able to save and load to/from it.
The details of this, however, are irrelevant. The problem is that I am trying to make each object that is interesting for the save file to be ab...
I'm using boost::program_options library to process command line params.
I need to accept a file name via -r option, in case if it is empty (-r given without params) I need to use stdin.
desc.add_options()
("replay,r", boost::program_options::value<std::string>(), "bla bla bla")
In this case boost wouldn't accept -r without params an...