Hi,
I've got a bunch of strings like:
"Hello, here's a test colon:. Here's a test semi-colon;"
I would like to replace that with
"Hello, here's a test colon:. Here's a test semi-colon;"
And so on for all printable ASCII values.
At present I'm using boost::regex_search to match &#(\d+);, building up a string as I process e...
I'm writing a C++ static library that needs to be shared among several applications, one of them written in Perl. Unfortunately, I only barely know the core Perl language (I read the Llama book), and I'm not all that familiar with its libraries. How do you make calls to an external C++ binary from a Perl script?
By Google search, I fo...
EDIT: This issue has been fixed by google in gtest 1.4.0; see the original bug report for more information.
I've recently switched to gtest for my C++ testing framework, and one great feature of it which I am presently unable to use is the ability to generate JUnit-style XML test reports, which could then be read in by our hudson build ...
In ANSI C++, how can I assign the cout stream to a variable name? What I want to do is, if the user has specified an output file name, I send output there, otherwise, send it to the screen. So something like:
ofstream outFile;
if (outFileRequested)
outFile.open("foo.txt", ios::out);
else
outFile = cout; // Will not compile bec...
I'm currently shopping for a FOSS parser generator for a project of mine. It has to support either C or C++.
I've looked at bison/flex and at boost::spirit.
I went from writing my own to spirit to bison to spirit to bison to spirit, each time hit by some feature I found unpleasant.
The thing I hate most about bison/flex is that they a...
Yes, I do understand the difference between them. What I want to know is: why OVERRIDE a method? What is the good in doing it?
In case of overload: the only advantage is you haven't to think in different names to functions?
...
Thank you guys so much for your help, this has been bothering me for a couple days.
I am using Windows Vista, and writing my program in C++, using straight Windows API(no MFC).
When I resize my window, the menu items flicker. My window class DOES NOT use CS_HREDRAW or CS_VREDRAW. I use double buffering for the CLIENT AREA, so the clien...
While porting a desktop application to windows mobile I've reached the following error:
Error LNK2019: unresolved external
symbol CompleteAuthToken referenced in
function
Reading MSDN it tell me that CompleteAuthToken is supported on Windows CE 2.10 and later and I should link against Secur32.lib, but adding that library didn't...
We're doing a great deal of floating-point to integer number conversions in our project. Basically, something like this
for(int i = 0; i < HUGE_NUMBER; i++)
int_array[i] = float_array[i];
The default C function which performs the conversion turns out to be quite time consuming.
Is there any work around (maybe a hand tuned functi...
I have a question on C++ double dispatch. In the code below, I want the results from the second set to match the results from the first set.
I don't know the actual type (unless I try dynamic_cast) but I do know that the object inherited from the BaseClass type. What is the most efficient (performance-wise) way to accomplish this?
Aft...
I am trying to figure out how C and C++ store large objects on the stack. Usually, the stack is the size of an integer, so I don't understand how larger objects are stored there. Do they simply take up multiple stack "slots"?
...
I have stumbled in this phrase in the web:
"C# is probably not the best choice for a system-level application like this. I believe plain C++ is much better here as you will need to do lots of low-level API calls."
I was searching about security programs made using c#, like firewal, parental control, anti-virus, anti-spyware, etc.
So, ...
Anyone have a link to what the C++ standard says regarding a compiler removing global and static symbols? I thought you weren't guaranteed that the compiler will remove global symbols if they're not referenced. A colleague of mine asserts that if your global symbols are included in the main translation unit, those symbols will not be re...
I would like to detect whether the OS I'm compiling on is Windows. Is there a simple macro I can check to verify that?
...
Suppose I have this in C++:
void test(int &i, int &j)
{
++i;
++j;
}
The values are altered inside the function and then used outside. How could I write a code that does the same in Java? I imagine I could return a class that encapsulates both values, but that seems really cumbersome.
...
In a visual studio C++ project, would MFC be faster than using the CLR? I'd specificily be using 2008.
Oh and the reason I ask is because I have experience with .NET but not so much with MFC. I understand what MFC is but have never really used it much.
...
I need a smart pointer for my project which can be send to several methods as parameter. I have checked *auto_ptr* and *shared_ptr* from boost. But IMO, that is not suitable for my requirements. Following are my findings
auto_ptr : When passed to another method, ownership will be transferred and underlying pointer will get deleted when ...
Hi,
Using POSIX threads & C++, I have an "Insert operation" which can only be done safely one at a time.
If I have multiple threads waiting to insert using pthread_join then spawning a new thread
when it finishes. Will they all receive the "thread complete" signal at once and spawn multiple inserts or is it safe to assume that the thr...
Firstly,
Using plain C++, without ATL, MFC attempting to use COM Object interface.
Using oleview (OLE/COM Object viewer) - used to engineer the IDL code.
At this stage, using MIDL Compiler, now I'm having trouble trying to produce the following:
Syntax on cmd line:
midl /nologo /env win32 /tlb ".\S8_.tlb" /h ".\S8_.h" /iid ".\S8_i.c...
I`m writing client-server app for windows using WinSock and I have class for server.
while initialising server I have such code:
class Server {
static const int MaxClients = 10;
std::vector connections;
CRITICAL_SECTION cs;
int port;
SOCKET ServerSocket;
sockaddr_in ServerAddress;
void init();
public:
S...