I want to insert something into a STL list in C++, but I only have a reverse iterator. What is the usual way to accomplish this?
This works: (of course it does)
std::list<int> l;
std::list<int>::iterator forward = l.begin();
l.insert(forward, 5);
This doesn't work: (what should I do instead?)
std::list<int> l;
std::list<int>::revers...
How do I launch an app and capture the output via stdout and maybe stderr?
I am writing an automated build system and I need to capture the output to analyze. I'd like to update the svn repo and grab the revision number so I can move the files in autobuild/revNumber/ if successful. I also would like to build using make and upload the co...
I have been working on a legacy c++ application and am definitely outside of my comfort-zone (a good thing), was wondering if anyone out there would be so kind as to give me a few pointers (pun intended)
I need to cast 2 bytes in an unsigned char array to an unsigned short. The bytes are consecutive.
For an example of what I am trying...
Is there ever a good reason to not declare a virtual destructor for a class? When should you specifically avoid writing one?
...
Is there any good book for c++ threading which uses boost threads.
Please post one book per answer
...
Hi,
We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snippets.
Appreciate the help in advance.
Edit: It is stri...
I'm writing a function for an installer DLL to verify the Authenticode signature of EXE files already installed on the system.
The function needs to:
A) verify that the signature is valid.
B) verify that the signer is our organization.
Because this is in an installer, and because this needs to run on older Win2k installations, I...
How can I determine if a Win32 thread has terminated?
The documentation for GetExitCodeThread warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons.
Thanks for the help! :)
...
In C++, how can I establish an SQL connection to store data in an SQL database?
...
From where I can download Turbo C++ setup, the one with blue srceen which we used in our academics..
...
Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI.
For example:
typedef std::bitset<16> WordSet;
Would it be possible to extract the number 16 in the above code without hard-coding it elsewhere? Compiler specific implementations are w...
I am getting a web host and i have projects with teammats. I thought it be a nice idea to have my own paste site that has no expiry date on paste (i know http://pastie.org/ exist) and other things. i wanted to know. Whats a simple highlight lib i can use on code? i would be only using C/C++.
...
Is this really the easiest way to do this?
http://simplesamples.info/MFC/Clipboard.php
...
If I have a template function, for example like this:
template<typename T>
void func(const std::vector<T>& v)
Is there any way I can determine within the function whether T is a pointer, or would I have to use another template function for this, ie:
template<typename T>
void func(const std::vector<T*>& v)
Thanks
...
I know that I am supposed to use delete [] when I used new [], so using auto_ptr with new [] is not such a bright idea.
However, while debugging delete [] (using Visual Studio 2005) I noticed that the call went into a function that looked like this:
void operator delete[]( void * p )
{
RTCCALLBACK(_RTC_Free_hook, (p, 0))
operat...
I am working on a big C++ project. It is building using single Ant script which makes possible to compile the same source targeting more than one platform and compiler.
But, I have to work only for Windows platform and Visual Studio 2005 C++ compiler. It would be really nice if I could write code and compile in Visual Studio, instead of...
I'm creating an ActiveX control that will be used in web pages to query the current installed version of a 3rd party software on the client machine. The control only needs to expose a single method - GetVersion - that returns the version as an integer. I'm very inexperienced with ActiveX, and I'm having problems with something as simple ...
The 'attach to process' dialogue box on VC6 running on win 2003 (I believe vista as well) has no processes to attach to in it... I've tried logging on as an administrator and running as an administrator but no luck. Any other ideas?
...
I have a process x that I want to check for leaks with valgrind. The problem is that x is run by y, and y in turn is run by z. I can't run x standalone because y and z setup the environment for x, such as environment variables, command line switches, files needed by x etc.
Is there any way I can tell valgrind to run on z but to fol...
What is the difference between using #include<filename> and #include<filename.h> in c++ which of the two is used and why it is used
...