Hi folks,
I have a c++ app that calls another python one (bundled into an exe with py2exe)
So I have 2 apps.
So I was wondering: What if my c++ did what py2exe does?
i.e. embed the python app in the c++ one. This way I won't depend on py2exe and its
configurations nighmares (yes, it has some)
Hence my questions:
how does py2ex...
This is what I'm trying to do and I can't:
#include <string>
using namespace std;
class A {
public:
bool has() const { return get().length(); }
string& get() { /* huge code here */ return s; }
private:
string s;
};
The error I'm getting is:
passing ‘const A’ as ‘this’ argument of
‘std::string& A::get()’ discards qualifiers
I ...
I have a small project where I need just part of boost library, boost::regex in particular. This is what I've done so far:
/include
/boost
/regex
/math
.. 189 dirs, files, etc.
/lib
/boost-regex
c_regex_traits.cpp
cpp_regex_traits.cpp
.. ~20 .cpp files
myprog.cpp
In my Makefile I compile all boost-regex .cp...
In scripting languages like Perl, it is possible to read a file into a variable in one shot.
open(FILEHANDLE,$file);
$content=<FILEHANDLE>;
What would be the most efficient way to do this in C++?
...
Is there any easy way to create at least a template XML file using XML Schema? My main interest is bounded by C++, but discussions of other programming languages are also welcome.By the way I also use QT framework.
...
The current C++0x draft states on section 29.3.9 and 29.3.10, pages 1111-1112 that in the following example:
// Thread 1
r1 = y.load(memory_order_relaxed);
x.store(1, memory_order_relaxed);
// Thread 2
r2 = x.load(memory_order_relaxed);
y.store(1, memory_order_relaxed);
The outcome r1 = r2 = 1 is possible since the operations of each...
i am working on a project where i am using SysRc values as return values from some function like SUCCESS and FAILURE ond sum enums .
Now i want to know how to get them print?
...
Hello,
I am trying to improve my knowledge on program architecture and recently arised a question to me which is related with this pointers issues I posted recently.
The thing is that in a simple hierarchy in which you have Class A with a pointers to Class B and the last to Class C. Do not confuse the with the inheritage property of th...
I am trying to use qsort from STL to sort array of edge:
struct edge
{
int w,v,weight;
};
by weight. What I am trying is:
int compare_e(const void *a, const void *b)
{
return ( *(edge *)a->weight - *(edge *)b->weight );
};
But I get:
`const void*' is not a
pointer-to-object type
EDIT:
Ok thx, now my code is compil...
Hi,
i am trouble with this..
Is there some solution or i have to keep exactly class types?
//header file
Class Car {
public:
Car();
virtual ~Car();
};
class Bmw:Car {
public:
Bmw();
virtual ~Bmw();
};
void Start(Car& mycar) {};
//cpp file
Car::Car(){}
Car::~Car() {}
Bmw::Bmw()
:Car::Car(){}
Bmw::~Bmw() {}
int...
I've been looking for a C++ SQL library implementation that is simple to hook in like SQLite, but faster and smaller. My projects are in games development and there's definitely a cutoff point between needing to pass the ACID test and wanting some extreme performance. I'm willing to move away from SQL string style queries, allowing it to...
I installed a global mouse hook function like this:
mouseEventHook = ::SetWindowsHookEx( WH_MOUSE_LL, mouseEventHookFn, thisModule, 0 );
The hook function looks like this:
RESULT CALLBACK mouseEventHookFn( int code, WPARAM wParam, LPARAM lParam )
{
if ( code == HC_ACTION ) {
PMSLLHOOKSTRUCT mi = (PMSLLHOOKSTRUCT)lParam;
...
I had a piece of code which uses windows SHFileOperation function with FO_MOVE operation. Additional flags specified were FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT.
A particular weird behavior was observed when the destination drive was full. In this case, MOVE could not place the file in destination folder but the source file was...
Hello everyone,
I have a test.exe that need to be called in my main application and run in the background (my main app must stay on top).
I know we can use CreateProcess with hide option in MFC, but in windows mobile library the startupinfo is unavailable.
So does anyone have an idea how to do ?
Besides, is there any way that we can l...
This is a follow up to my previous question.
Consider that I write a function with the following prototype:
int a_function(Foo val);
Where foo is believed to be a type defined unsigned int. This is unfortunately not verifiable for lack of documentation.
So, someone comes along and uses a_function, but calls it with an unsigned int ...
Hi,
I've got a C/C++ question, can I reuse functions across different object files or projects without writing the function headers twice? (one for defining the function and one for declaring it)
I don't know much about C/C++, Delphi and D. I assume that in Delphi or D, you would just write once what arguments a function takes and then...
Hi,
I have an issue with the following code :
class quicksort {
private:
void _sort(double_it begin, double_it end)
{
if ( begin == end ) { return ; }
double_it it = partition(begin, end, bind2nd(less<double>(), *begin)) ;
iter_swap(begin, it-1);
_sort(begin, it-1);
_sort(it, end);
}
public:
quicksort (){}
...
I have several C++ strings with some words. I need to get first word from every string. Then I have to put all of them into a char array. How can I do it?
Thanks i advance!
...
C++ is one of the most used programming language in the world since like 25+ years.
My first job as programmer was in C++ and I coded in C++ everyday for nearly 4 years. Now I do mostly PHP, but I will forever cherish this C++ background.
C++ has helped me understand many "under the hood" features/behaviors/restrictions of many other (...
I needed to include a few c headers ( non standard header files ) in my C++ code to be compiled by gcc. The C header (foo.h) has support for :
#ifdef __cplusplus
extern "C" {
#endif
and similarly at the end for }. The c++ code has the include "foo.h"
I believe I should be able to just include the header (foo.h) and create instan...