I have created a test application to illustrate my problem. It parses a list of integers preceded by "a=" or "b=" and is separated by "\r\n". The list contains multiple occurrences of those fields in any order.
#include <string>
#include <vector>
#include <iostream>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/includ...
Is there a way to know, at a real time, what threads are opened and what application opened them?
...
Hi, I'm working on a project involving the Microsoft Unified Communications Client API; uccapi.dll. I'm also using Codegear C++Builder 2010, not Visual Studio. After registering the dll with regsvr32 and importing it as type library into C++Builder 2010, uccapi_tlb- and uccapi_ocx-files were generated. When having imported these into my ...
What are the major advantages of interfaces in designing application and the differences with respect to inheritance. can any body provide me with the brief example.
...
Hi Guys,
in my project I'm making use of Eigen C++ library for linear algebra. ONLY when I turn on the vectorization flags (-mfpu=neon -mfloat-abi=softfp) for ARM NEON, I get a compiler error - c++config.h no such file or directory.
I'm not able to understand whats going wrong, what is this bits/c++config.h? What should I do to fix thi...
Similar to this question but with objects instead of pointers.
If I have the following code
Foo f;
vector<Foo> vect;
vect.push_back(f);
vect.erase(vect.begin());
Where does my object go? Is delete called on it? What if someone else holds a pointer to it? Is this a memory leak?
...
So here I believe I have a small buffer overflow problem I found when reviewing someone else's code. It immediately struck me as incorrect, and potentially dangerous, but admittedly I couldn't explain the ACTUAL consequences of this "mistake", if any.
I had written up a test app to demonstrate the error, but found (to my dismay) that it...
Hi all,
I've included
#import <CHUD/CHUD.h>
in my header files, and added
"-F$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks"
to my Framework Search Paths. I also added
'-weak_framework CHUD'
to my Other Linker Flags.
I've tried copying the CHUD.framework folder from /System/Library/PrivateFrameworks to my iOS SDK's System/Librar...
Consider this program:
#include <stdio.h>
int main() {
printf("%s\n", __FILE__);
return 0;
}
Depending on the name of the file, this program works - or not. The issue I'm facing is that I'd like to print the name of the current file in an encoding-safe way. However, in case the file has funny characters which cannot be represe...
how can i make screen-shots of the local pc screen with win32 c++?
...
Hi All,
I'm writing a drawing program. I'm trying to take an ordered list mouse positions, and approximate a smooth Quadratic BSpline Curve. Does anyone know how to accomplish this?
Thanks!
...
Hi,
I'd like to calculate the square and square-root of a vector of doubles. For example given:
vector<double> Array1(10,2.0);
vector<double> Array2(10,2.0);
for(unsigned int i=0; i<Array1.size(); i++)
Array1[i] = sqrt(Array1[i]);
for(unsigned int i=0; i<Array2.size(); i++)
Array2[i] = Array2[i] * Array2[i];
Is the...
How can I write only every third item in a char buffer to file quickly in C++?
I get a three-channel image from my camera, but each channel contains the same info (the image is grayscale). I'd like to write only one channel to disk to save space and make the writes faster, since this is part of a real-time, data collection system.
C++...
In my opinion, the following code (from some C++ question) should lead to UB, but the it seems it is not. Here is the code:
#include <iostream>
using namespace std;
class some{ public: ~some() { cout<<"some's destructor"<<endl; } };
int main() { some s; s.~some(); }
and the answer is:
some's destructor
some's destructor
I learned f...
Hi,
I have a software that runs over 2 000 computers on my company, without any issues.
This software, at some time, generate a GUID (or UUID) using UuidCreateSequential() (MSDN link).
The call usually returns RPC_S_OK on every computer. But on one of them, it always returns RPC_S_UUID_LOCAL_ONLY.
The documentation states that:
T...
Lets say i have a Poco::Thread:
Thread Parent has an eventhandler method within it.
The parent then spawns two children threads, who are given events that are the parent subscribes the eventhandler to.
So two events both have the same event handler attached.
If Child A triggers their event, and Parent starts to execute it, what would hap...
Say we have a class inheriting from two base classes (multiple inheritance). Base class A is abstract, declaring a pure virtual function foo, the other base class B declares and implements a function foo of the very same signature.
struct A
{
virtual void foo(int i) = 0;
};
struct B
{
virtual void foo(int i) {}
};
struct C : publi...
I am having troubles trying to make my project work with kdevelop.
In the CMakeLists.txt I have included the paths to the libraries that I use:
cmake_minimum_required(VERSION 2.4.6)
PROJECT(Ormapi)
INCLUDE_DIRECTORIES("/dir/whatever/local/dir/include") < here is defined global.h
INCLUDE_DIRECTORIES("/dir/whatever/local/src")
ADD...
I'm moving from Java to C++ right now and I'm having some difficulties whenever a commonly used concept in Java doesn't map directly into C++. For instance, in Java I would do something like:
Fruit GetFruit(String fruitName) {
Fruit fruit;
if(fruitName == "apple") fruit = new Fruit("apple");
else if(fruitName == "banana") f...
CImg<unsigned char> src("image.jpg");
int width = src.width();
int height = src.height();
unsigned char* ptr = src.data(10,10);
How can I get rgb from ptr?
...