I have the following tricky problem: I have implemented a (rather complicated) class which represents mathematical functions in a multiwavelet basis. Since operations like +, - and * are quite natural in this context, I have implemented overloaded operators for this class:
FunctionTree<D> operator+(FunctionTree<D> &inpTree);
FunctionTre...
How can I get Eclipse to build many binaries at a time within one project (without writing a Makefile by hand)?
I have a CGI project that results in multiple .cgi programs to be run by the web server, plus several libraries used by them. The hand-made Makefile used to build it slowly becomes unmaintainable. We use Eclipse's "Internal Bu...
What are the most common or vicious mistakes when experienced C++ programmers develop in C#?
...
My project contains shared library and exe client. I found that my own exception class thrown from the library is not caught by client catch block, and program terminates with "terminate called after throwing an instance of ..." message. Continuing to play with the project, I found that any exception of any type is not caught. For exampl...
Well i wrote a c++ app for a Windows CE device and selected the platform (from the sdk that came with the CD) for it, if i open the project file it says Platform Name="IEI_PXA270_E205 (ARMV4I)"
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="BootInstall"
Pr...
How to decode string in c++.
for example utf8 to cp1251 or koi8-r to utf8
...
Hello everyone,
I am using native C++ with VSTS 2008. A quick question about virtual function. In my sample below, any differences if I declare Foo as "virtual void Foo()" or "void Foo()" in class Derived? Any impact to any future classes which will derive from class Derived?
class Base
{
public:
Base()
{
}
virtual vo...
Is this possible to hide fullscreen window (SDL based application)?
How can I do this?
...
How would I export functions defined in a C# class library, while enabling them to be imported to and called from an unmanaged C++ application/DLL ?
...
I have this code:
#include <iostream>
#include <functional>
struct A
{
int operator()(int i) const {
std::cout << "F: " << i << std::endl;
return i + 1;
}
};
int main()
{
A a;
std::tr1::function<int(int)> f = std::tr1::ref(a);
std::cout << f(6) << std::endl;
}
The aim is to pass the functor object...
So, I'm busy making a model viewer, I'm trying to get my dialog properly setup, and get my openGL view ports squared ( I'm using picture box controls for it ), one big problem. Visual studio doesn't allow me to set the the size manually, I can't see the actual pixel size. I can only see it in the bottom right corner of the screen but tha...
I'm trying to use operator overloading to define the basic operations (+,-,*,/) for my polynomial class but when i run the program it crashes and my computer frozes.
Update4
Ok. i successfully made three of the operations, the only one left is division.
Here's what I got:
polinom operator*(const polinom& P) const
{
polinom Result...
I know this is probably a stupid question, but I need to be sure; I came accross some legacy code that contains a function like this:
LPCTSTR returnString()
{
char buffer[50000];
LPCTSTR t;
/*Some code here that copies some string into buffer*/
t = buffer;
return t;
}
Now, I strongly suspect that this is wrong. ...
Hey guys, I am trying to implement a image recognition program in C++. I had completed the extracted of feature, now trying to save the large amount of numbers. I had 2 implementation in mind, one is to save the data into binary files, to reduce the overhead of computation, or i can use database to keep the information. Binary file is fa...
What is the difference between delete and delete[] operators in C++?
...
If I want to make an OS X program as self-contained as possible to ease installation, what dynamic libraries can I expect everyone or most people to have? If I know that, I won't have to compile static libraries for everything.
...
The following code does not give a warning with g++ 4.1.1 and -Wall.
int octalStrToInt(const std::string& s)
{
return strtol(s.c_str(), 0, 8);
}
I was expecting a warning because strtol returns a long int but my function is only returning a plain int. Might other compilers emit a warning here? Should I cast the return value ...
There are two ways to overload operators for a C++ class:
Inside class
class Vector2
{
public:
float x, y ;
Vector2 operator+( const Vector2 & other )
{
Vector2 ans ;
ans.x = x + other.x ;
ans.y = y + other.y ;
return ans ;
}
} ;
Outside class
class Vector2
{
public:
float x, y ;
...
interested in absolute time, rather than a way to measure the duration.
Win32 API
c++
...
I've got a handle to a window and its richEdit control. Would I be able to replace the said control with one of my own ? I'd like it to behave as the original one would, i.e., be a part of the window and suchlike.
I'll elaborate the scenario further - I'm currently disassembling an application one of whose features is a text editor. My ...