c++

Running an executable with parameters in C++ and get the return value;

How do you run an executable with parameters passed on it from a C++ program and how do you get the return value from it? Something like this: c:\myprogram.exe -v ...

Convert double to String with fixed width

I want to convert a double to string with fixed width. If the width is 10, then I want the double value to get round off to this width. For example, if value = 102.121323435345 and width is 10, then this value should be, position==> 0123456789 value = 102.121323 I can achieve this with snprintf, but I am lo...

Triangle Triangle Intersection On 3d Sapace

Hi, Now i m Working on 3d . In that I need to find intersection of triangle with other triangle. How to find it. Please Help. ...

Multiple Indirection C++ Integer types

im trying to remove an element from my array and was wondering if I could be ultra-efficeint using multiple indirection with my int ptrs. The maxSize for my fixed-array lies within my hashTable->maxSize I need to be able to refer to my hashTable's private member maxSize only as a reference. The varaible: &maxSize, holds nothing, it is...

stepping into MACRO in VC++

I am debugging a source code that has a lot of big #define'd MACRO routines. I am interesting in stepping into them, but I guess, VC++ does not allow step-in functionality ... so, I am converting them into functions, but this is becoming hard for me Is there a way to step into MACRO routines? especially in VC++? PS: I can port the w...

How to use C++ Classes exported by a dll in Delphi

Hi, is there a way to use C++ classes exported by a win32 dll in Delphi for win32? Are there other ways to archieve similar things (COM, .NET, ...)? ...

Uploading to Amazon S3 using cURL/libcurl

Hi I am currently trying to develop an application to upload files to an Amazon S3 bucket using cURL and c++. After carefully reading the S3 developers guide I have started implementing my application using cURL and forming the Header as described by the Developers guide and after lots of trials and errors to determine the best way to c...

Code coverage tools for Symbian C++ and Maemo

What code coverage tools have you used with Symbian C++ and Maemo? What are the pros and cons of the tool you are using? ...

how to convert ascii to unsigned int

Is there a method that converts string to unsigned int? _ultoa exists but couldn't find the vise verse version... ...

How do I remove unnecessary resources from my project?

I am working with a very big project (a solution that contains 16 projects and each project contains about 100 files). It is written in C++/C# with Visual Studio 2005. One of the projects has around 2000 resources out of which only 400 are actually used. How do I remove those unused resources? I tried to accomplish the task by searc...

Using flyweight pattern to share bitmaps between bitmap objects

Hello stack overflowers, I have a desing that uses the flyweight pattern to share bitmaps that are shared between bitmap objects which manage drawing ops, etc. and integrate in the gui library. This is an embedded device so memory is at a premium. Currently I have done a working implementation with a std::vector of auto_ptr of a light cl...

Reversing strings in a vector using for_each and bind

Hi! I was wandering how it's possible to reverese strings that are contained in a vector using a single for_each command just in one "simple" line. Yea, I know it is easy with a custom functor, but I can't accept, that it can't be done using bind (at least I couldn't do it). #include <vector> #include <string> #include <algorithm> std...

C++ & GCC: How Does GCC's C++ Implementation Handle Division by Zero?

Just out of interest. How does GCC's C++ implementation handle it's standard number types being divided by zero? Also interested in hearing about how other compiler's work in relation to zero division. Feel free to go into detail. This is not purely for entertainment as it semi-relates to a uni assignment. Cheers, Chaz ...

How to cast template class ptr to normal class ptr in C++

Hello, I have question regarding macros. How could I cast through macro a template class to normal class. In example: #define RUNTIME_CLASS(class_name) ((CRuntimeClass*)(&class##class_name)) template<typename T> A {}; if (RUNTIME_CLASS(A)); I know that this code woun't compile because it will not see template bit. But I don't unders...

std::vector and its iterator as single template typename

In order to get an "easier-to-remember" interface to the index-generating function std::distance(a,b), I came up with the idea of a better distinction of it's arguments (when used against the base of a vector: vec.begin() ) by calling a templated function with the vector and its iterator, like: std::vector<MyType> vect; std::vector<My...

Tiny serializer

I have a family of classes that contain only variables of the following types: std::string, int, double. I should be able to serialize/deserialize objects of these classes to/from C string (null terminated). I don't want to use some 3rdparty serializer and do not want to write full-featured serializer by myself. I will serialize/deserial...

structure in template class

sample code is as follow: struct TEMP { int j; TEMP() { j = 0; } }; template<typename T> class classA { struct strA { long i; strA():i(0) {} }; static strA obj_str; classA(); }; template<typename T> classA<T>::classA() {} template<typename T> classA<TEMP>::strA classA<TEMP>::o...

A pointer to abstract template base class?

Dears, I cannot figure this out. I need to have an abstract template base class, which is the following: template <class T> class Dendrite { public: Dendrite() { } virtual ~Dendrite() { } virtual void Get(std::vect...

C++ windows time

Hello, I have a problem in using time. I want to use and get microseconds on windows using C++. I can't find the way. Thnaks ...

Debugger Visualizer for non-managed C++ code?

Hi - Does anyone know of a C++ IDE or debugger that's supports debugger visualizers for unmanaged C++ code? The problem is that Visual Studio's debugger visaulizer supports only managed C++. Thanks, Olumide PS: I'm still open to using VS if I can find a technique for making the visualizer work with unmanaged C++. ...