So I have 2 functions that both have similar arguments
void example(int a, int b, ...);
void exampleB(int b, ...);
Now example calls exampleB, but how can I pass along the variables in the variable argument list without modifying exampleB (as this is already used elsewhere too).
...
Hi,
Is there way that I can read the file from remote server using fopen or any other api.
Thanks
Avinash
...
I'm new to unit testing. I want to code unit tests in Qt, but my functions(login, request etc...) heavily depend on other resources such as a server.
How can I supply a block box in this situation?
Do you know any open source project which I can examine unit test classes for similar situations?
...
I have tried to write my first Boost program from information on the Boost libraries site.
Here is the code:
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
std::for_each(
in(std::cin)...
Is there a way one can use custom priorities in syslog daemon or rsyslog daemon?
i.e. i am unable to locate a configuration change which achives it.. the other thing i can do is perhaps play with it's source.
Cheers!
...
Is it possible to initialize a static const value outside of Constructor ? at member declerations ?
class A{
private:
static const int a = 4;
...
...
};
...
IF a string may include several un-necessary elements, e.g., such as @, #, $,%.
How to find them and delete them?
I know this requires a loop iteration, but I do not know how to represent sth such as @, #, $,%.
If you can give me a code example, then I will be really appreciated.
...
I'm working on the open project gridlabd hosted at sourceforge. I was trying to call the create_thread function: static __inline int create_thread(void * (*proc)(void *), void *arg)
I just don't understand for the life of me what in the world void * (*proc)(void *) means.....
As a side note, did stack overflow add an option for Jon Ske...
I tried to compile the code below with Clang
class Prasoon{
static const int dummy = 0;
};
int const Prasoon::dummy = 0;
int main(){}
The above code did not give any error when compiled with Clang.
prasoon@prasoon-desktop ~ $ clang++ --version
clang version 2.8 (trunk 107611)
Target: i386-pc-linux-gnu
Thread model: posix
prasoo...
I'm looking for a fast and much lightweight as possible open source virtual machine for implementing my custom programming language. The virtual machine should support some minimal set of bytecode (like LLVM IR), but can easily embedable from a C++ application (which filters out LLVM from the list). It should be wrriten in C/C++.
I'm l...
I recently read that Java now sports initialisation blocks like the following:
class C {
public C() { /* Instance Construction */ }
static { /* Static Initialisation */ }
{ /* Instance Initialisation */ }
}
I was particularly interested in the static block. It got me thinking about the static initialisation order problem...
I have a list of possible paths to use for a default input data directory (X:\Data; Y:\Data; Z:\Data). All of the possible paths are mapped network drives. I can check this using GetDriveType(pathStr) == DRIVE_REMOTE. To determine the best one, I have narrowed down the list by selecting only paths that exist. Sometimes there will be more...
Like this function in C:
size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );
I've looked in c++ file stream and found this one:
ostream& write ( const char* s , streamsize n );
this one only accepts char* instead of void*
but does it really matter if i use a c-style fwrite function in c++>
...
Hi,
I'm writing a windows application in C++ and encountered the following problem when working with exceptions.
I have a base exception class from which all other exceptions derive from. In the base class I have a method for the error message of any exception. That method then returns the exception (through '*this').
Now, the problem...
HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath)
{
const WCHAR wszStreamName[] = L"ActiveMovieGraph";
HRESULT hr;
IStorage *pStorage = NULL;
// First, create a document file that will hold the GRF file
hr = StgCreateDocfile(
wszPath,
STGM_CREATE │ STGM_TRANSACTED │ STGM_READWRITE │
...
Today I was doing the thread ring exercise from the Programming Erlang book and googled for other solutions to compare. I found that the language shootout has exactly this the same problem as a benchmark. I had the impression that this is an area where Erlang should be fastest, but turns out that C and C++ are again on top. My suspicion ...
Hey all,
I recently ported a project from Visual Studio .NET 2003 to Visual Studio 2010. The problem here is that my code uses the built-in VC++7.1 _input. _input is used in a function which simulates the functionality of GNU glibc's vsscanf().
I realize that VS2010 provides _input_l as a replacement, however this function crashes con...
A hypothetical question: Is it possible to have a C++ program, which includes preprocessor directives, entirely on one line.
Such a line would look like this:
#define foo #ifdef foo #define bar #endif
What are the semantics of such a line?
Further, are there any combinations of directives which are impossible to construct on one li...
Hi,
I'm using the triangle++ wrapper class from http://www.compgeom.com/~piyush/scripts/triangle/ to triangulate a point cloud for visulaizing with OpenGL.
I was able to put in my points and caluculate the triangulation. After that i also was able to access the vertices over a vertex iterator, how it is shown in the main.cpp example inc...
Possible Duplicates:
Code polisher / reformater for C, C++ or Fortran
Best C++ Code Formatter/Beautifier
I am working as part of a team on a C++ project. Part of the code is a highly modified version of a large-ish external library, which doesn't conform to our coding conventions.
The library uses this style:
void main ()
...