Hi I'm been looking around how to convert big endian to little endians. But I didn't find any good that could solve my problem. It seem to be there's many way you can do this conversion. Anyway this following code works ok in a big endian system. But how should I write a conversion function so it will work on little endian system as well...
How can I call SDL functions from C++ in OS X without a main method? I'm building a dynamic library that does the initialization. The application that calls it depends only on the library.
I realize that I need to somehow create an autorelease pool in Objective-C, because SDL_Init() crashes as it's now, but I don't know how. SDLmain cre...
I'm trying to find an elegant way to parse a string like:
EVENT_TYPE(param1;param2; ...)
EVENT_TYPE is one of many string constants, each has zero or more parameters.
So far I thought that given the sting "s" contains EVENT_TYPE(param1;param2) I'd write:
if (boost::istarts_with(s, "EVENT_TYPE")) {
std::istringstream iss(s);
int p...
I am having problems with a stringstream object. My class has an input stream as a member.
I am checking if obj->istream and after thatn if obj->istream->good().
The stream exists but the call to good() crashes. I am in Visual Studio 2005. Any clue?
How do I reset an istream?
if (soap->is) {
if (soap->is->good())
return so...
1)template <class T = int, class U = double> //compiles
2)template <class T, class U =double> //compiles
3)template <class T = int, class U> //fails
Why does 1 and 2 compile whereas 3 does not?
...
Hi,
I am new to multi-threaded programming and have a question about pthreads.
This is the test code that I run and I don't understand its behaviour. Can someone throw some light on it please.
void *t1(void *args){
printf("returning from t1\n");
return;
}
void *t2(void *args){
printf("returning from t2\n");
...
Hi ;)
I have succesfully using dyld -macosx- to interpose standard C functions to a third party application, getting important information about the workarounds it does. But what I really need is to replace a certain function of a certain class.
The function I want to override is QString::append(..., ..., ...), so each time a string is...
May order of members in binary architecture of objects of a class somehow have an impact on performance of applications which use that class? and I'm wondering about how to decide order of members of PODs in case the answer is yes since programmer defines order of members via order of their declaraions
...
Hello,
QueryDosDevice(L"E:", DeviceName, MAX_PATH);
(E: is a SD card)
DeviceName is "\Device\HarddiskVolume3"
How do I "convert" it to something like "\\.\PHYSICALDRIVE1"
...
In following this example code for binary injection:
http://www.security.org.sg/code/loadexe.html
I can get it to work, inject a second exe into the primary exe's memory space and run. The trouble is that the second exe can not access any DLL's in the startup folder.
For example:
c:\1.exe
c:\2.exe
c:\helper.dll
If 2.exe is injected...
I'm connected to my Universities small Linux cluster via PuTTY and WinSCP, transferring files using the latter and compiling and running them with the former. My work so far as all been in the Uni labs and today I've been doing some work at home and hit an interesting warning.
I uploaded an entire folder of stuff and upon running make i...
I am writing a program that needs to take an array of size n and convert that into it's hex value as follows:
int a[] = { 0, 1, 1, 0 };
I would like to take each value of the array to represent it as binary and convert it to a hex value. In this case:
0x6000000000000000; // 0110...0
it also has to be packed to the right with 0's t...
How do I format my console output so that it's aligned to the right in C++?
...
I have a file format (.STL, stereo lithography, the structure is standard and can not be changed. Not to be confused with standard template library) that uses a 50 byte data structure. Reading from the HD directly leads to wrong data being read as 50 bytes is not a multiple of 4.
Out of the entire 50 byte structure, I only need 36 of th...
Have run into a bug with glibc's malloc(): http://sourceware.org/bugzilla/show_bug.cgi?id=4349 and am thinking a work around for now until updating to later version of glibc is to do pooled allocation for small objects that have many instances coming and going.
The small objects are all derived from an abstract base class. I'd like to ...
I am trying to use cublas.h in visual studio. The program doesn't compile because it can't find some of the external link. Can some one tell me how to link the .dll file, I believe it is in ../C/common/bin. Thanks.
...
Hi all,
I have a question regarding shared_ptrs and ownership in C++:
I have a bunch of objects created on the heap. Each one has a container which holds pointers to some of these objects, and sometimes, even a pointer to the same object the container belongs to. Since I read about the risks of using shared_ptr under such circumstances...
Hi I am getting the following Linking error while compiling ConvolutionFFT2D from CUDA src
1>------ Rebuild All started: Project: FinalTest, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'FinalTest', configuration
'Release|Win32'
1>Compiling with CUDA Build Rule...
1>"C:\CUDA\bin\nvc...
Just wondering if anyone knows of a C++ library that provides a single interface for querying database schema (tables, fields, field types), and for a variety of vendors? I know DTL does this to some degree, although I haven't dug into the details of how it does it, or if it makes that info available external to itself.
*ODBC is probab...
How do I make it so that the cin statement only accepts integers?
...