I asked a similar question in this posting and learned from the replys but
I still can't get it to work.
test_vector.h
#include <vector>
class Node
{
public:
std::vector<Node*>& node_dict;
int depth;
char* cargo;
Node* left;
Node* right;
Node( int a_depth, std::vector<Node*>& a_dict);
...
I'm working on my first COM project that is importing a c# DLL with a C# COM Wrapper class into a C++ native code application. Our application is based on the CSRegFreeCOMServer VS2008 sample project from Microsoft's All-In-One Framework. Our system is using - VS2008, .Net3.5, boost 1.4.2 and Qt 4.6.2.
This application has been runn...
Hi!
I need to make a function which adds a function pointer to map. It would be something like this:
bool RegisterFunction (string name, FunctionPointer function).
But I have problem with calling it, because I don't know how to pass function to it instead of result of function (when I call this as here:
RegisterFunction ("run", Run()...
I'm an experienced coder, but am still relatively new to the STL, and have just come across this problem:
As far as I'm aware, STL containers aren't meant to copy the objects which they contain, or otherwise affect their lifecycles, yet experimentally I'm seeing different results.
In particular, string classes, which are meant to zero ...
I'm writing a program and I want the user to be able to specify whether the output is written to a file or to stdout. Until this point, my program has been using printf commands, so I was hoping to simply change the commands to fprintf commands, but my compiler is shouting at me because obviously, they are not the same object classes.
...
In C++, when a method is declared, I've noticed that sometime the method may have an assignement appended to it.
Could anyone tell me what this is?
For example:
virtual void MyMethod () = 0;
What doe the '= 0' mean. :)
Thanks everyone !!!
...
Hi,
I'm modifying a C++ application and I'd like to add the ability to print and existing PDF using the MFC printing logic (OnPrint...)
Is there any method to print a PDF into the MFC? Now I'm converting the PDF to a BMP but sometimes the quality is not so great.
...
while working in c/c++,
1.cin/cout
or
2.scanf/printf ,
which one of both , will have less execution or run time.
OR both will have equal runtime.
my aim is to reduce the runtime of my code.
...
I'm having problem at mipmapping the textures on different hardware. I use the following code:
char *exts = (char *)glGetString(GL_EXTENSIONS);
if(strstr(exts, "SGIS_generate_mipmap") == NULL){
// use gluBuild2DMipmaps()
}else{
// use GL_GENERATE_MIPMAP
}
But on some cards it says GL_GENERATE_MIPMAP is supported when its not,...
Below is something that did happen to me and I couldn't get what's wrong. My coworker and me screwed our heads around this. It was in a cross-platform library using the cross-platform toolkit wxWidgets on Windows
#include <wx/wx.h>
class Graph {
public:
// ...
// main1.cpp:4:10: error: expected identifier before '(' token
double...
Just like i asked in the title? What are the best engines for a (small) indie game? I am interested in infos about how much does it take to familiarize with the engine, special functions et cetera.
In addition, I would like to know what physics engine I should use for this type of game.
Thanks in advance:D
...
In some of the LLVM tutorials I'm seen where it's fairly easy to bind C function into a custom language based on LLVM. LLVM hands the programmer a pointer to the function that can be then be mixed in with the code being generated by LLVM.
What's the best method to do this with C++ libraries. Let's say I have a fairly complex library lik...
The simple version of my project is rotating a sphere based on user input.
However my rotations get weird after multiple rotations in certain situations due to openGL's local coordinate system.
What I really need is to rotate based on a world/fixed coordinate system. Such that when I rotate the sphere once its rotation axes are not rota...
Hey StackOverflow, first time posting here after having so many of my Google results come up from this wonderful site.
Basically, I'd like to find the name of the variable stored at a particular memory address. I have a memory editing application I wrote that edits a single value, the problem being that every time the application holdin...
There is an example on cdecl that goes (double (^)(int))foofoo means cast foofoo into block (int) returning double.
What does it mean to cast foofoo into a "block" of int? What does the symbol ^ exactly mean in this context. Usually it is bitwise XOR.
...
Hi i have a program that deals alot with vectors and indexes of the elements of these vectors , and I was wondering :
is there a difference between uint and unsigned int
which is better to use one of the above types or just use "int" as I read some people say compiler does handle int values more efficiently , but if i used int i will ...
Hello everyone :)
I'm still working on a good solution to my One-Of-A-Type Container Problem -- and upon reflection I think it would be nice to be able to just use something like a std::map<std::type_info, boost::any>. Unfortunately, std::type_info does not define an operator<, and I think it'd be unreasonable for it to define one.
How...
I have a std::map<int,int> lets call it my_map
I iterate through this map using iterators and a for loop.
Within each iteration I want to modify many elements in this map but restore it again to its original values for next iteration of the loop.
I thought I could create a temporary copy of the iterator my_temp_map , but then I wouldn...
Hi all,
I'm doing some tests to a LinkedList, that has two pointers: one point to the next item in the list and the other point to a random node within the list.
Here is the code:
struct Node
{
Node* pNext; // a pointer to the next node in the list
Node* pReference; // a pointer to a random node within the list
int num...
I have some clean up in a terminate_handler and it is possible to throw an exception. Do I need to worry about catching it to prevent recursive calls to the terminate_handler? With gcc, it seems this can't happen and we just go into abort. Is that true of the standard or is the behavior undefined?
...