c++

how can watch youtube flv in c++ application ?

hello all im using c++ to get you-tube video links , but now i like to be able to play team (stream ) in my application , using c++ wxwidgets cross platform what option do i have ? ...

How to know and load all images in a specific folder??

Hi every body: I have an application (C++ Builder 6.0) that needs to know the total of images there are in a specific folder, and then I have to load them: in an ImageList or in a ComboBoxEx... or any other control... How can I do that? I know how to load an image in a control, or to save in a TList, or in an ImageList... but How to k...

Fine to have variables in a namespace?

I have a set of functions that work on a file. Originally I made it into a class, with the only private member being a static const std::string which was the name of the file. The user used these functions by creating an object and calling functions from it. However, I think I'm going to switch to using a namespace, since it's just a set...

How do you create a freestanding C++ program?

I'm just wondering how you create a freestanding program in C++? Edit: By freestanding I mean a program that doesn't run in a hosted envrioment (eg. OS). I want my program to be the first program the computer loads, instead of the OS. ...

Interview test for applied scientific computing job

Do you know a good and objective question/test to examine applicants for a scientific computing job? (In fact, this test comes after the candidate passed an interview.) 1st) They need to be intelligent. (Edit, thanks for the words from Trent) 2nd) They would have to deal mostly with programming (C++ and Python, using scientific librar...

Are Constants Really Appropriate Here, Or Is There Another Approach? - C++

Hi there, I'm a programming student in my 2nd OOP course, which is taught in C++. I know that it is generally bad practice to use magic numbers in code, so here's my question: In the next program I have to write for this class, there is over 120 numbers given to us in tax tables, and we need to use them to compute tax and other relevan...

Storage of a high score table, what kind of container?

Say I have a high score table structured like name score name score .... I need to do some file operations and manipulate certain areas of the file, and I thought the best way to do this would be to store it in a container that preserved the order of the file, do the data manipulation with the container, then output back to the file. ...

Producer/Consumer For Talking to Devices Serially

Here is my problem: I have to be able to send and receive to a device over serial. This has to be done in a multi-threaded fashion. The flow is as follows: Wait for device to send me something - or if idle, then query status to see if online with device If device sends me something, then process message, acknowledge, and tell device to...

A good C alternative for Boost.Program_options?

Any good alternative written in C to replace Boost.Program_options? Given it's able to parse: Short options like -h Long options like --help --input-file Parse repeated keys/options Accepts key-value pairs: --mysql=/usr/lib Parsing environmental variables and XML/INI files is optional. ...

Dual purpose code commenting(users & maintainers)...HOW?

Hi, I am writing a C++ static library and I have been commenting with doxygen comments in the implementation files. I have never really had to care very much about documentation but I am working on something now that needs to be documented well for the users and also I am trying to replace my previous bad habit of just wanting to code a...

DLL EXE Hybrid C++ Windows

I am currently working with DLL injection and need to have a single hybrid binary that could act as both an executable and a DLL. I thought of maybe writing a DllMain and WinMain function and then compiling it as an executable but I don't know what would happen if I did that. I know that it is posssible to combine a dll and exe by using ...

protected inheritance

Why protected and private inheritance are defined and proposed? I understand some cases private inheritance could be used but it is not recommended. How about protected inheritance? Can anyone offer me an situation in which protected inheritance is a choice? I rarely see this. Thanks so much! ...

What datatype to use for image data to avoid std:bad_alloc?

I'm developping an imaging library and I'm struggling with the image data datatype Since images can have variable datatypes (8 bits per pixel, 16 bits per pixel) I thought of implementing my image data pointer to void* pimage_data; however void* leads to all kind of nastiness including ugly pointer arithmetics such as pimage_data ...

queue from the stl

I am trying to get the following code to compile using g++ 4.2.1 and am receiving the following errors CODE: #include <iostream> #include <queue> using namespace std; int main (int argc, char * const argv[]) { queue<int> myqueue(); for(int i = 0; i < 10; i++) myqueue.push(i); cout << myqueue.size(); retu...

vector<bool>::push_back bug in GCC 3.4.3?

The following code crashes for me using GCC to build for ARM: #include <vector> using namespace std; void foo(vector<bool>& bools) { bools.push_back(true); } int main(int argc, char** argv) { vector<bool> bools; bool b = false; bools.push_back(b); } My compiler is: arm_v5t_le-gcc (GCC) 3.4.3 (MontaVista 3.4.3-25.0....

How to separate CUDA code into multiple files

I am trying separate a CUDA program into two separate .cu files in effort to edge closer to writing a real app in C++. I have a simple little program that: Allocates a memory on the host and the device. Initializes the host array to a series of numbers. Copies the host array to a device array Finds the square of all the elements in the...

Catching exceptions by value, reference or pointer

Possible Duplicate: catch exception by pointer in C++ What is the best way to catch an exception: by value, reference or pointer and why? ...

Unhandled exception: 0x80000001: Not implemented. (VC++)

Hi all, I am using MS Visual Studio 2005 (C++).. Could anyone tell me what could cause a runtime exception like so..? Unhandled exception at 0x07ed0027 (xxx.dll) in yyy.exe: 0x80000001: Not implemented. xxx.dll is a dll i am working on and yyy.exe is an exe that is calling that dll.. When the undhandled exception comes up while d...

Run a C++ Program from Django Framework

I need to run a C++ Program from Django Framework. In a sense, I get inputs from UI in views.py . Once I have these inputs, I need to process the input using my C++ program and use those results. Is it possible ? ...

Why can't we create objects for an abstract class in C++?

I know it is not allowed in C++, but why? What if it was allowed, what would the problems be? ...