c++

Getting user input in C++ without halting the program

Hi, I have a C++ program that captures videos, and I would like to be able create a command-line program to update its frame rate, image format, etc on the fly. How can I do this without halting the entire program? I need it to be able to wait for user input, but still capture videos at the same time. I know this will probably involve...

How do I display/draw a .ply object in OpenGL?

I'm trying to make OpenGL draw the figure that I'm loading with OPENFILENAME. What I've got right now is: I can display the comments, vertex, how many faces, etc., but I cannot draw the figure and I'm not sure how to do it. I can draw other predetermined figures, but not the ones I'm trying to open. This is where I'm initializing ever...

[AMD CodeAnalyst] which params show cache misses?

I need to know which parts of my code make the most cache misses.. suggest which parameters of the profiling report I need to monitor, there are too many of them there ^_^ ...

Error C2079, what order to define classes in

Hi, I'm getting a compiler error with this header file: #ifndef GAME1_H #define GAME1_H #include "GLGraphics.h" #include "DrawBatch.h" class GameComponent; class Game1 { private: GLGraphics graphics; GameComponent components; void updateDelegates(); void Run(); }; class GameComponent { private: static...

Difference between template name and template id

C++ Standard Section 14/2 : In a function template declaration, the declarator-id shall be a template-name (i.e., not a template-id). [Note: in a class template declaration, if the declarator-id is a template-id, the declaration declares a class template partial specialization. What is the difference b...

C++ recursive data types

Hello. A bit of a noob question: I need classes A and B such that A has a B* member and B has an A* member. When compiling I get "error: ISO C++ forbids declaration of ‘B’ with no type". How can I get around this? ...

Graph better than Google charts?

Possible Duplicate: Generate line graph for any benchmark? What services do you recommend to generate graphs for benchmark results, like the following? http://developer.studivz.net/wp-content/uploads/2009/03/splminheap_rw_mixed.png Some of the web services I had used were dodgy at best to make these graphs. ...

Using '>>' across gcc and visual c++

We are writing an application that compiles with both gcc and Visual C++. Some team members only use Visual C++/Windows, and others only use gcc/linux. Due to differences between compilers the build sometimes breaks. I have "fixed" several scenarios that lead to build breaks using compiler options to enable/disable warnings, but currentl...

Injecting string to 'cin'

I have a function that reads user input from std::cin, and I want to write a unittest that inserts some strings into std::cin, such that later extraction from std::cin will read that string instead of pausing for keyboard input. Ideally, I would change the function signature so that I can pass a custom istream as parameters, but I can't...

problem in coding

Possible Duplicate: Sorting in arrays int A[5]={1,5,3,2,4}; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ if(A[j]>A[j+1]) { int t=A[j]; A[j]=A[j+1]; A[j+1]=t; } } } for(i=0;i<5;i++) cout<<A[i]; The desired output must be 1,2,3,4,5 but my output is 0,1,2,3,4. ...

Signaling failure in qt slots

I have a 'producer' object, that steps through some data and emits various signals depending on what data item is next in the queue. Each of those signals are processed by at most one 'consumer' object at a time (it takes care to disconnect its slots before attaching the producer's signals to the other consumer). If the processing on t...

C++ code browsing

Is there any simple way of finding the implementation of a virtual method in a IDE like Visual Studio. Finding references and reference from one class to other consumes a whole lot of time. Is there a quicker way of using the IDE or in general any IDE. Also if there has been only one project changed can I quickly get the executable link...

Placeholder for C++0x's <thread> header in MSVC++ 2010

I already use some new features from C++0x in Visual C++ 2010, like regular expressions or lambda functions. But there is one major feature that is missing: the <thread> header. Do you know any code which could act as a replacement? For the moment I'm using boost's thread, but it's not exactly the same as the standard, and it gives me ...

millisecond-accurate benchmarking in C++?

I do not really wish to profile because I was wanting to do many different small benchmarks on different simple functions. For the life of me I cannot find a way to record the amount of milliseconds in C++, I am using Linux by the way. Can you suggest the method to get the system clock in milliseconds (I may settle with seconds if I can...

how to create c++ programs without the requirement of .net framework to run (like ccleaner and utorrent)

i was wondering how programs like ccleaner and utorrent are made? AFAIK they are written in C++ but they run without the need of .net framework and apparently run on windows 98 as well. How can this be done? Visual c++ requires .net framework to be installed to run the binary file. While .net framework is free, it can be a hassle and i...

How to check if an other program is running in fullscreen mode, eg. a media player..

Hi, How can I check if an other app is running in full screen mode & topmost in c++ MFC? I just want to disable all of my auto dialogs (warnings) if media player or other players are running. (Like silent/gamer mode in Avast.) How could I do that? Thank you. ...

C++: Store large numbers in a float like PHP?

In PHP if you go above INT_MAX it will cast it as a float, allowing very high numbers to be formed (that are non-decimal as well), is this possible to do in C++ or are the way they store floating point/double precision numbers different? The reason why is I am wishing to benchmark large factorials, but something such as 80! is way too l...

Capture MacBook Pro iSight video with C++

Hi guys, i'd like to grab a frame from my MacBook Pro iSight in C++ and do some elaborations on it. I already know how to do that in ObjC with QTKit, but is there any way to do the same thing in C++? NOTE: I tried to install OpenCV with macports, but the framework doesn't seem to support iSight cameras. Thanks ...

My Visual C++ compiler compiles out of date source

I'm a beginner starting to use Microsoft Visual C++ Express 2010 for Windows Programming. I've created a new C++ application using native code, not managed or MFC. I had Visual Studio create for me the basic windows code to create one window with simple menus (chat.cpp). I modified this file and I was able to compile correctly and see my...

May a compiler ever generate code to unload parts of the code segment during execution ?

Apart from Dll concept that provides ability of loading/unloading methods or functions at run-time, I'm wondering if a compiler may ever say something like, ok as this particular part of the code takes considerable amount of space in code segment and is never gonna be used again after this point during program execution, it'd be good to ...