c++

What is the equivalent of UpdateWindow() in wxWidgets?

I am new to wxWidgets and trying to find out how to force the painting of a window. ...

How can i format a decimal to a fraction with limits to the denominator

Hi All I am trying to format a decimal A into a fraction B + C/D, where certain limit is imposed on D, say D could be one among [2...9] or [2...19] etc. BCD are integers The goal is to get the formatted fraction as close to the decimal as possible. Is there an existing algorithm/theory on this? Or is there any API I can call on Mac SDK?...

Is it possible to generate a parser for a language using the Reverse Polish notation with bison/yacc?

Is it possible to generate a parser for a scripting language that uses the Reverse Polish notation (and a Postscript-like syntax) using bison/yacc? The parser should be able to parse code like /fib { dup dup 1 eq exch 0 eq or not { dup 1 sub fib exch 2 sub fib add } if } def ...

What is the exact use of inline functions?

Possible Duplicate: Benefits of inline functions in C++? Hi, what is the exact usage of inline functions, what exactly inline function does in brief. on what basis a programmer has to choose the function as inline. i Googled the answer but still i prefer stackoverflow. ...

WMV Playback using Phonon::VideoWidget and Flip4Mac fails in 32-bit builds

My application needs to run on Windows and Mac OS X and display various kinds of media files, such as videos and Adobe Flash content. After installing the Flip4Mac codec, I can play WMV video using Phonon on the Mac. In order to support Flash via the Flash plugin in a QWebView, I need to build a 32-bit binary. But when I do that, WMV pla...

C++ undefined reference when linking

Im wondering if anyone would be able to help me as I have been scratching my head for two days on this. I have done the compilation and when trying to link a source code on linux getting undefined reference Compiling using, g++ -g -I/u01/kasunt/workspace/corelibCORBA/include -I/u01/kasunt/workspace/corelibCORBA/installed_compo...

C++ multi-dimensional array initialization

Hey Guys, in C++ I want to initialize a double matrix (2-dimensional double array) like I would normally do without pointers like so: double data[4][4] = { 1.0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; However, since I want to return and pass it to functions, I need it as a double** pointer. So, basically I need to initia...

what is the execution order of a threaded and non-threaded function call?

hello, i have written a simple console application just to try boost::thread, i am a multithreading newbie by the way. here is the code #include <iostream> #include <boost/thread/thread.hpp> #include <windows.h> using namespace std; void Avg(double * Src, double *Dst, int Per, int Len, string& s ) { LARGE_INTEGER s1,s2,f; Que...

how do i compile a C++program to work in the windows operating system using g++ for linux?

I am new to writing programs in c++ and i want to know if there is a way to export it to a windows format. Also what is a good way to learn objective-c, is it very different from c++? Thank you in advance. ...

Are Preprocessor Definitions compiled into a library?

Hi, First off, if this question has already been asked or way too naive, I apologize. I searched for it and could not find it. Are they (preprocessor definitions) compiled into a static/dynamic library? For example, the FBX SDK needs KFBX_DLLINFO. A library that makes use of FBX SDK must include that. Now the client application, as fa...

Firefox Plugin Domain Restriction - Similar to IE's SiteLock

Hello everybody, I would like to know if there is any functionality in the Gecko SDK/NPAPI that would allow me to restrict a plugin-usage to restricted domains only. Exactly like SiteLock for IE does with ActiveX components. Any similar implementation in NPAPI, for example? ...

read_graphviz @ boost lib c++ 1.44 compile error

i try the sample case in it's own example "boost_1_44_0/libs/graph/example/ospf-example.cpp". but i get this error messages "/tmp/ccZ6LRQJ.o: In function `bool boost::read_graphviz_new, std::allocator >, boost::no_property>, boost::property, std::allocator >" first, i think that's compile link error, not include the lib path, but i ch...

Waiting child processes

I try fork child processes and wait them to die.I first fork N child processes and then wait in a loop. But it seems it doesn't wait the child processes to die.It exits the loop altough the childs do not die. Here's my code: void DistributorSubsystem::Start() { Application::instance().logger().information("Distributor Subsytem s...

Closest point implementation

i am trying to implement closest point program here is code #include <iostream> #include <cstdlib> #include <math.h> using namespace std; float randfloat(){ return 1.0*rand()/RAND_MAX; } class point { public : float x,y; float distance(point& a){ float dx=x-a.x; float dy=y-a.y; return sqrt(dx*dx+dy*dy); } }; int main(i...

Any difference between these two in c++?

new char[1] and new char,essentially the same thing,hm? ...

How to optimize/refactor such code?

In the current project, there are lots of GetData() method, which get different kind of data from hand written database at run time, and set them in different fields in a class. The projects then have such methods. void GetData(Datatype type, int& value); void GetData(Datatype type, double& value); void GetData(Datatype type, long& valu...

What is Vtable in C++

Possible Duplicate: why do I need virtual table? What is vtAble in C++. Got to know vtable is a virtual table which has an array of pointers to virtual functions. Is there a article with practical implementation. Any walk through is greatly appreciated. ...

3d rendering of a surface from a depthmap

Hi, Using stereovision, I am producing depthmaps representing the 3d environment as viewed from a camera. There is one depthmap per "keyframe" associated with a camera position. The goal is to translate those 2d depthmaps into the 3d space (and later merge them to reconstruct the whole environment). What would be the best (efficient) w...

What compiler do to perform cast operation in c++?

Possible Duplicate: How do C/C++ compilers handle type casting? explain with some some with C++.. ...

How essential is polymorphism for writing a text editor?

Many years ago when I didn't know much about object oriented design I heard one guy said something like "How can you write a text editor without polymorphism?" I didn't know much about OOP and so I couldn't judge how wise that though was or ask any specific questions at that time. Now, after many years of software development (mostly C+...