Faster modulus in C/C#?

C#
Is there a trick for creating a faster integer modulus than the standard % operator for particular bases? For my program, I'd be looking for around 1...
2 years ago

C# COM INTEROP in c++

C#
I'm trying to call my C# dll from a C++ client, so far I have the dll all setup and in my registry (I can create and call it from the power shell for ...
1 year ago

Xcode & C/C++ project

C
I want to use Xcode for C/C++ project. I don't care about build/compilation, all i want is to use it as editor. Needs: - Find symobol , References , ...
1 year ago

Memory alignment in C/C++

C++
I was reading Game Coding Complete 4th edition. There is a topic regarding Memory alignment. In the code below author says that first struct is really...
1 year ago

CRC32 C or C++ implementation

C
I'm looking for an implementation of CRC32 in C or C++ that is explicitly licensed as being no cost or public domain. The implementation here seems n...
1 year ago

Endless loop in C/C++

C
There are several possibilities to do an endless loop, here are a few I would choose: for(;;) {} while(1) {} / while(true) {} do {} while(1) / do {}...
1 year ago

C/C++ global variable uniqueness?

C
Consider the following: // defs.h extern "C" { typedef struct t_state { bool b; } t_state; static t_state _state; void...
1 year ago

Fake Mouse (C# or C++)

C#
I need a way to fake that a mouse is connected. The problem: My HTPC (Windows 8) has no mouse connected and I wrote a program to simulate mouse input ...
1 year ago

C/C++ Sound OS API

Linux
I have a question about sound. I have used sound libraries like OpenAL in my projects before. What I need, is insight as to what underling OS APIs the...
1 year ago

C# Multidimensional Arrays in C++?

C#
I'm converting a C# class to C++ and i'm currently blocked by the following part: public class Perlin { const int B = 0x100; const int BM = 0...
1 year ago

C++ for Objective-C programmer

C++
I know there are a lot of "Objective-C for the C++ programmer" information out there and it could be used the other way around. I'm just curious if th...
1 year ago

Bit Operation in C / C++

C
When we talk Bit Operation in C or C++. Does bit start from bit0 or bit1 ? Which one is more make sense? As I know A bit can assume either of two val...
1 year ago

.DLL C++ function to C#

C#
I'm using mpusbapi.dll in WPF project using C#. In C++ the function prototype is: DWORD MPUSBWrite(HANDLE handle, PVOID pData,...
1 year ago

Calling C/C++ from python?

C
What would be the quickest way to construct a python binding to a C or C++ library? (using windows if this matters)
1 year ago

mix cobol with c++/C

C++
I tried to mix COBOL code with C++, but i not have success :( I see this topic in IBM forum: http://publib.boulder.ibm.com/infocenter/comphelp/v111v1...
1 year ago

Validate DNA in C/C++

C
I am iterating over DNA sequences pulling out chunks of 5-15 bases at a time into C++ std::string objects. Occasionally, my string will contain a non...
1 year ago

calling c function from C#

C#
as a simple example, i have a C function which receives an int,increment it and return incremented value.on the other side I enter the input number to...
1 year ago

C / C++ / C#: Howto do "mount -a"

C
Question: In C/C++/C#. (I need it for C#, but C and C++ is also fine). How can I do a mount -a on Linux. I mean programmatically, without starting a...
1 year ago

Readability a=b=c or a=c; b=c;?

C#
I have a class which has a group of integers, say foo() { int a; int b; int c; int d; .... string s; } Now the question is for the best...
1 year ago

C and C++ linkage with extern "C"

C
I have a C++ function defined in a .h file as follows and implemented in a .cpp file: extern "C" void func(bool first, float min, float* state[6], fl...
2 years ago