I'm writing some C++ code that manipulates a bunch of vectors that are changing in size and are thus being reallocated constantly.
I would like to get a "pointer" into these vectors that remains valid even after reallocation of the vector. More specifically, I just want these "pointers" to remember which vector they point into and the ...
typedef boost::variant<long long,double,string> possibleTypes ;
set<possibleTypes,less<possibleTypes> > ascSet ;
set<possibleTypes,greater<possibleTypes> > descSet ;
When I try to compile I get a bunch of errors in some library headers.
But, if I remove the third line (the one with descSet ) the code compile just fine.
What's the pro...
To attach a winforms dialog on Microsoft Wordpad toolbar/menubar?
...
I'm using C++ without .NET on Win32, how can I download an image over HTTP from a website without having to re-invent the wheel? Is there an API or library that provides a single function to do this?
http://mywebsite/file.imgext --> C:\path\to\dir\file.imgext
...
Hi,
In my other question, I've been trying to find someone who knows where to find free open source OCR library for C#. However, it seems there is only C++ library and obviously, C++ is not C#.
One of the responds suggested to write my own wrapper in C#. I have pretty much no idea how to do it, where to learn to do it, or what it actua...
I'm evaluating Cruise (NOTE! Not CruiseControl but Cruise (commercial)) for doing CI with an unmanaged MSVC++ 2008 project. I use GoogleTest framework for my unit test. I know that GTest can output its result as an JUnit XML or XML format. My question is, does Cruise support JUnit/XML format?
How would Cruise know whether or not my unit...
Hi, I quite recently learned about the C++ classes friend keyword and the uses in serialization and now I need some help in getting it to work.
I have no problem serializing my class to a file, it's working great, however i'm having a hard time trying to read this file into a vector container. I'm sure I need a loop in my code that read...
I would like to ask if the use of mutable is appropriate here:
#include <iostream>
class Base
{
protected:
int x;
public:
virtual void NoMod() const
{
std::cout << x << std::endl;
}
void Draw() const
{
this->NoMod();
}
};
class Derive : public Base
{
private:
mutable int y;
public:
void NoMod() const
{
...
Hello. I am trying to use some socket network programming in C++. I am trying to send the text "Hello World!" to a server using the C++ send() function. At first, I set the buffer to the size of 13 since "Hello World!" altogether is 12 characters (you have to make it one more than the character count). The send function only sends the ch...
I've been batting this problem around in my head for a few days now and haven't come to any satisfactory conclusions so I figured I would ask the SO crew for their opinion. For a game that I'm working on I'm using a Component Object Model as described here and here. It's actually going fairly well but my current storage solution is turni...
I know how to "hide" them. I know about FreeConsole(); and then finding the handle and changing it's attributes. However with these methods the window still pops up for a second than goes away. How can I stop it from showing up completely?
...
I looked through some code and noticed that the convention was to turn pointer types like
SomeStruct*
into
typedef SomeStruct* pSomeStruct;
Is there any merit to this?
...
In C++, I believe, a better way of dealing with reallocation is to use a STL vectors, as it guarantees the contiguous storage locations.
I have couple question to understand the difference:
Is there any scenario in which I need to prefer realloc over vector ?
Is there anything else ( apart from vector ) which is equivalent to realloc...
I keep getting told that in this line of code passing argument from incompatible pointer type.
Here's the line of code:
if (linear_search (size_of_A, argv[i]))
What does this mean and how do I fix it? Here is the whole program:
int linear_search ( int size_of_A, char*argv[]){
int i;
i = 2;
while (i <= size_of_A - 1...
How to keep the source code well documented/commented? Is there a tool to generate a skeleton for comments on the Unix platform for C++?
In general, how many lines of comments is recommended for a file with around 100 lines of code?
...
I have some custom dtrace probes in a C-library, and when linking and using the library with a C application my probes work fine, however when linked against C++ it says it can't find them. The reason seems to be because of C++ mangling, and trying to get it to work has become a duck chase.
Any ideas?
Note: Using gcc
...
I am trying to do ODBC import with DSN-Less connection(using text driver). Is there any way to tell SQLDriverConnect to set COLNAMEHEADER=yes/no? OR I need to use schema.ini to do it?
Actually i don't want to create schema.ini manually, Can I use SQLConfigDataSource for dsn less connection? I haven't found any docs regarding this.
Tha...
I was looking recently for a toolkit/library with good unicode support. I had checked ICU, Qt3, Qt4 and Glib. Unfortunalty all of them with exception of ICU had some missing features or had implemented them incorrectly.
Unfortunalty, ICU library has quite bad documentation and is very hard to use because it ignores most of modern C++ de...
My application uses Microsoft RPC for interprocess communications. When two processes are run on the same machine and one process tries to call a method declared as (IDL notation):
error_status_t rpcMethod( [in] pipe byte parameter );
this call fails with RPC_S_CANNOT_SUPPORT ("The requested operation is not supported") and never reac...
Why double.Epsilon != std::numeric_limits<double>::min()?
On my PC:
double.Epsilon == 4.9406564584124654E-324 and is defined in .NET
std::numeric_limits<double>::min() == 2.2250738585072014e-308
Is there a way to get 2.2250738585072014e-308 from .NET?
...