c++

usage of clutter for game development

I'm a relatively new developer, and I'm looking to learn C++. I've had experience coding in java, javascript, actionscript, and python, but I want something fast enough to do some high performance 2D and 3D games. When I eventually learn the basics (control structures, classes, etc) I'd like to develop a 2D game. I've explored various l...

Is there "magic" in the STL?

Let me start with explaining what I mean with "magic". I will use two examples from Java: Every class inherits (directly or indirectly) the Object class. Operator overloading is not supported by Java but the + operator is defined for String objects. This means that it is impossible to make an implementation of the Object and String c...

String tokenizer for CPP String ?

I want to use string Tokenizer for CPP string but all I could find was for Char*. Is there anything similar for CPP string ? Thanks in advance ...

enable_shared_from_this and objects on stack

What about calling shared_from_this for stack allocated objects ? enable_shared_from_this in base classes list is indicator for user of derived class for creating it's only on heap (and we sholuld just hope for correct class usage) or we can have some more strong protection against such errors ? Or I don't understand some moments ? Examp...

C++: Can a struct inherit from a class?

I am looking at the implementation of an API that I am using. I noticed that a struct is inheriting from a class and I paused to ponder on it... First, I didn't see in the C++ manual I studied with that a struct could inherit from another struct: struct A {}; struct B : public A {}; I guess that in such a case, struct B inherits f...

why is the value being changed even in a const function?

#include<iostream> using namespace std; class temp { int value1; public : void fun() const { ((temp*)this)->value1 = 10; } void print() { cout<<value1<<endl; } }; int main() { temp t; t.fun(); t.print(); } ...

QT heap memory corruption

Hi, I'm writing a QT4.6 application(without the qt designer) and when I close the program I get this error from Visual Studio: Windows has triggered a breakpoint in Test.exe. This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLs it has loaded. This may also be due to the u...

how do i use the c++ dll in c#

i like import c++ dll in my c# application how can i Do this?, what is concept i need to use for this? ...

How to find the neighbours of a node in Lemon

In the Lemon C++ Graph Library, given a node in an undirected graph say, how does one find other nodes that are edge connected? ...

Sort based on multiple things in C++

struct Record { char Surname[20]; char Initial; unsigned short int Gender; //0 = male | 1 = female unsigned short int Age; }; Record X[100]; How can I use Quicksort to sort the values into increasing age, with females before males and surnames in alphabetical order? I've got a: bool CompareData(const int& A, const int&...

How to get directories,subdirectories, files creation date & time from FTP remote Server in C++ ?

hi, How to get directories,subdirectories, files creation date & time from FTP remote Server in C++ ? I want to create a FTP client in C++ ...

Why does the postfix increment operator take a dummy parameter?

Have a look at these function signatures: class Number { public: Number& operator++ (); // prefix ++ Number operator++ (int); // postfix ++ }; Prefix doesn't take any parameter but postfix does. Why? I thought we can recognize them with different return types. ...

Does reinterpret_cast store a copy of object pointer?

when a reinterpret_cast is applied to a class object, it returns a LONG_PTR. is it some sort of handle to a temporary object pointer stored somewhere in memory? ...

debugging a process spawned with CreateProcess in Visual Studio

I've created a Windows/C++/WTL application that spawns a child process. The two processes communicate via anonymous pipes. I'd like to be able to debug the child process. Since both parent and child projects are in the same solution in Visual Studio 2008, is there any way to tell VS2008 that I'd like the debugger to debug both proce...

QString, remove labels and content?

Hi, message.Text() is a QString. I want to remove some text. The text can be: Normal: "This is a text" With a label: "<label1>something</label1>This is a text" First, I find if the text has the label: !message.Text().contains("<label1>", Qt::CaseInsensitive)) So, if it has, I want to remove the first part, to have a normal text...

Invoke and Debug doesn't work

Hello, I use Eclipse CDT (Helios) with cygwin and the most things works fine, but I can't run and debug my applications. I start the invoke or the debug and it ends immediately. There is no error or anything like that. What can I do to get it running? Thanks for any advice or idea. ...

Is there a native/reliable alternative for boost::shared_ptr in VC++ ?

My company doesn't allow the use of boost (for many stupid reasons, but that's off-topic). I feel very frustrated having to use raw pointers when I'm used to shared_ptr, weak_ptr and scoped_ptr for personal development. We're working exclusively with Microsoft compilers (Visual Studio 2010) and I wonder if there was an alternative to t...

What does mean this C++ code: "void Foo() throw;"?

Question from the one interview. Please explain what does this C++ code mean: void Foo() throw; ...

reinterpret_cast cast cost

My understanding is that C++ reinterpret_cast and C pointer cast is a just a compile-time functionality and that it has no performance cost at all. Is this true? ...

Load Resource from other DLL

Hi there, i had a Projekt that worked with VS 2003. Then i ported it with the help of the Studio to 2008. Now the following class crashes when i start the Application in Debug mode. The crash occurs in the Function calling CDialog::Create(IDD_DIALOG_BANNER, wnd); void CPOLBannerDlg::Show(){ AFX_MANAGE_STATE(AfxGetStaticModuleS...