Let's say that I've created two different program executables, e.g. in C++.
For some reason, the two programs internals representation of text are different from each other. Let's say the first program is using text representation A and the other text representation B. It could be a specific 8-bit ANSI codepage, Unicode/UTF-8 or Unicode...
Hi,
I have a string& parameter, and i want to assign it to string parameter.
How can it be done.
...
When I set references for a C++ project in Visual Studio 2010, it fails to load a reference dll from another c# project because of a version mismatch. Building a C# project that references another c# project is no issue for me. I tried hard coding the version number for the c# project which worked great, but that was simply for testing a...
I have a python Interpreter written in C++, the PyRun_String function from the Python API is said to return a handle, however in my code I have it assigned to pointer to a PyObject?
PyObject* presult = PyRun_String(code, parse_mode, dict, dict);
Is this actually correct? Can you implicitly cast this handle to this object pointer?
S...
How can I tell the linker that statically link libfoo.a while building the shared object sharedobj.so using gcc/make.
I have tried to pass the LDFLAG options
LDFLAGS += -W1 --whole-archive -L/path/to/libfoo -lfoo
I have also tried to pass LDFLAGS the options
LDFLAGS += -W1, static -L/path/to/libfoo -lfoo
I have also tried to pass LD...
Hi,
I have a header like this (header guards not shown):
class GameSystem
{
public:
GameSystem(Game *pcGame);
virtual ~GameSystem();
void Setup();
private:
void InitGame();
void RunGame();
void ExitGame();
Game *m_pcGame;
/* Properties */
int m_nWidth;
int m_nHeight;
int m_nFps;
bool m_b...
Hey there, I have the following code:
sVal = analogRead(potPin); // read the value from the sensor
valMin = min(sVal, 1);
valMax = max(sVal, 128);
constrain(sVal,valMin,valMax);
itoa(sVal, res, 10);
println(res);
println(" ");
delay(150);
clearScreen();
Now for some reason, the output on the gLCD screen is almost...
Can anyone recommend an open source soft modem (a software only emulation of a modem card), that runs on Linux?
Preferably, this will be implemented in C/C++
...
How would you change the precision of a number for example: float n = 1.2345 and store it back to the variable 'n' with changing it to 1.23 ?
...
Hi,
Is there a short way to toggle a boolean?
With integers we can do operations like this:
int i = 4;
i *= 4; // equals 16
/* Which is equivalent to */
i = i * 4;
So is there also something for booleans (like the *= operator for ints)?
In C++:
bool booleanWithAVeryLongName = true;
booleanWithAVeryLongName = !booleanWithAVeryLongN...
I was curious about C++ and virtual inheritance - in particular, the way that vtable conflicts are resolved between bass and child classes. I won't pretend to understand the specifics on how they work, but what I've gleamed so far is that their is a small delay caused by using virtual functions due to that resolution. My question then is...
int java declaration of array like this
int a[][]=new int[3][3] works but in c++ not why? please help me i have not used c++ a long time so please help me
...
I am creating some custom exception classes doing the following
class GXException
{
public:
GXException(LPCWSTR pTxt):pReason(pTxt){};
LPCWSTR pReason;
};
class GXVideoException : GXException
{
public:
GXVideoException(LPCWSTR pTxt):pReason(pTxt){};
LPCWSTR pReason;
};
When I created GXVideoException to extend GXExcep...
Does anybody know what permissions are needed to create ITASK?
This is the error I am getting in C++:
Error creating ITask. Error: -2147024891
...
Question
I wish to know if this is a viable way to implement variable depth recursion so that I can run a function at each step and any better/other solutions to the description problem.
Description
Suppose I wish to have a function that fills an array either in pattern
x,y,x,y,x,ywhere x and y are variables defined by some algorithm
and...
Hi,
I cannot figure out how to change the text color of one particular item of a QComboBox. I was able to change the Background color of an item:
comboBox->setItemData(i, Qt::green, Qt::BackgroundRole);
(Qt::ForegroundRole had no effect at all, Qt 4.6, Ubuntu 10.04)
and I was able to change the text color of all items with a styleshee...
I have some function:
void addNormalLine(int id, LineNumber number, Rate smsRate, Rate callRate) {
list<Account>::iterator iAccounts;
findAccount(iAccounts, id);
if(iAccounts == listOfAccounts.end()){
throw "AccountDoesNotExist";
}
if(lineExists(number)){
throw "LineExists";
} else...
I am looking for a C++ library set to develop my own C++ daemon in Linux for collecting NetFlow information. Does anyone know of an open source one or a library set that is available?
Many thanks
...
I want to display very high resolution video directly with OpenGL.
The image data is going to be processed on the GPU and I want to avoid a round-trip back to the PC to show the video in a standard bitmap based window.
Cross platform is nice, Windows only would be OK (so would nvidia only)
Anyone have any links to ways doing this? ...
I want to write a function to generate and store the co-ordinates of an n-cube and I have no idea how to start. Specifically, I wish to generate the co-ordinates for an evenly or randomly distributed cloud of points for this n-cube and store them. What would be a good way to start with this or if possible, a quick solution?
...