c++

Binary parser or serialization ?

I want to store a graph of different objects for a game, their classes may or may not be related, they may or may not contain vectors of simple structures. I want parsing operation to be fast, data can be pretty big. Adding new things should not be hard, and it should not break backward compatibility. Smaller file size is kind of impor...

what do i need to do to make my c++ program run by only entering the name on my unix system

Possible Duplicate: Code wont run. [not] I have written and compiled a program and i want to make it so that from shell i can just type programname to make it run instead of going to the directory the the program is in and typing ./ before the program name. If this is possible please let me know. ...

What good is virtual in a class ?

Possible Duplicate: C++ Virtual/Pure Virtual Explained For example i have: class A { private: int i; int j; public: void k (int l, int m) { i=l; j=m; } virtual int n (void); }; class B : public A { public: int n (void); }; What good is this virtual ? ...

Why doesn't this Boost ASIO code work with this python client?

This code is identical to the original udp async echo server, but with a different socket. The response is transmitted and showing in wireshark, but then an ICMP Port Unreachable error is sent back to the server. I'm trying to understand why because everything looks correct. You can copy this code directly into a source file e.g. serv...

c++ interface question

Hi, I have Package A (Namespace A), which has header file say internalItems.hpp, contains a class with enumeration of items to be created and methods to get and set item type. Now this class has to be made available in common package (Package Common with Namespace COMMON) so that other package (let says Package EndUser with Namespace ...

how to use Savitzky-Golay smooth coefficient to calculate derivatives

Savitzky-Golay smoothing filter can be used to calculate the coefficients so as to calculate the smoothed y-values by applying the coefficients to the adjacent values. The smoothed curve looks great. According to the papers, the coefficients can also be used to calculate the derivatives up to 5th order. The coefficients calculation para...

wWinmain, Unicode, and Mingw.

Hello, I am working on learning the windows API and am using mingw as my compiler with Code::Blocks as my IDE. I have run into an issue with using the wWinMain function. I used the program located here link text. It compiles fine on VSC++ 2008 express but when using mingw i get the "undefined reference to WinMain@16" error. I have fi...

incorporate .so into another .so without dependency?

i have a c program that relies on a second library whose compilation i can control. i want to be able to compile my program into a shared object library without it linking to the second library. in other words i want a single monolithic shared object library at the end. how can i do this? if i separately compile the second library into ...

Objective-C/C++ constants

Hi, EDIT: My example might have created some confusion. I have changed the example below to reflect what I want to achieve. Hope this is more clear. I am trying to define a constant in my objective-c code. I am using the standard #define to do this. Eg: #define bluh "a" I would like to define another constant like this #define...

c++ free Profiler

i need a free profiler that works in win7 and compabitly with vs2010 thanks ...

Is it true that all c libraries can be used in c++?

Quite a newbie question as is. ...

C++ template member variable in templatized class has incomplete type

I have code similar to the following in a header file: template<class A> class List { private: QVector<A> _list; }; where QVector is the standard QT container. When I try to make a variable of type List as a member variable in another header file like this: class Model { private: List<int *> the_list; }; I get the fo...

SDL C++ Application not doing anything when built using Visual Studio 2010

Hi, I've just started using C++ again after using solely VB for a year and I wanted to try my hand at cross platform development. So I started learning to use SDL (which is very very easy thankfully) to create simple graphics driven games like Pong and Tetris. I am compiling the code with Microsoft VisualStudio 2010 Enterprise edition, a...

Are all functions in the c++ standard library required have external linkage?

So I've got an app which compiles fine on windows, linux and a few variations of unix. I recently decided to port it to OSX when I ran into a snag. I have a template which looks like this: template<int (&F)(int)> int safe_ctype(unsigned char c) { return F(c); } the idea being to prevent sign extension from crashing certain implementa...

Sound processing in C++ on Windows - a nudge in the right direction

I want to write a simple sound editor with a very specific purpose: cutting and re-gluing an audio file (which will contain spoken prose) in such a way that each sentence is repeated N times. (This is for foreign language learning.) I don't want to use an existing sound editor because I would like to tailor the GUI specifically for this...

About Google's protobuf

I know it can be used to send/receive structured object from file, but can it be used to send/receive sequences of structured object from a socket? http://code.google.com/p/protobuf/ ...

What is meant by 'use of a function'

$3.6.1/3 states- "The function main shall not be used (3.2) within a program.". The sample academically motivated program below uses the name 'main' in a couple of ways which I thought are legitimate. This is based on the assumption that 'usage of a function' is related to calling the function (directly/indirectly). struct MyCla...

C++ assignment operator - compiler generated or custom?

I have a medium complex C++ class which holds a set of data read from disc. It contains an eclectic mix of floats, ints and structures and is now in general use. During a major code review it was asked whether we have a custom assignment operator or we rely on the compiler generated version and if so, how do we know it works correctly? ...

c++ repaint part of window

i want to repaint part of the window not the whole thing. i have no idea how to. im using win32 please no mfc........ thanks in advance // create rect structure RECT rect2; rect2.left=0; rect2.top=0; rect2.right=225; rect2.bottom=300; // calling invalidateRect when left mouse button is donw case WM_LBUTTONDOWN: InvalidateRect(hWnd, ...

Need to convert this unix assembly code execution to windows equivalent

I am totally new to assembly; currently i am trying to convert the undermentioned assembly code execution to windows equivalent but not even getting a single hint. Any help in porting the undermentioned code in asm block to windows equivalent will be highly appreciated. void cpuid(uint32_t idx, uint32_t *eax, ...