C is a general-purpose computer programming language used for operating systems, games and other high performance work.

learn more… | top users | synonyms

0
votes
1answer
38 views

DNS-SD implementation

I am trying to implement DNS-SD, and I understand how it works, but don't really understand the purpose, so I have a few questions about it. Let us assume that we have two devices on local network, ...
-2
votes
1answer
799 views

Bresenham Vs Midpoint Circle drawing algorithm

Can somebody explain the difference between Bresenham and Midpoint Circle drawing algorithms? All I am able to understand is that in both algorithms we compute coordinates of an octant instead of ...
3
votes
0answers
404 views

Fast fixed-size (256 bit) integer modulo/division

What is the fastest way to divide two 256-bit integers? They are represented as an array of 26-bit words, each stored in 32-bit integers. I have access to a 64-bit type if that's useful. It seems ...
2
votes
0answers
30 views

Zeromq bidirectional asynchronous transmission?

I have a system which consists of two applications. Currently, two applications communicate using multiple zeromq publish/subscribe sockets generated for each specific type of transmission. Sockets ...
2
votes
0answers
104 views

What are the benefits of an input/output component design?

For the company I work at, all of our projects, including a new one started last year, are written in C89. We write for vxWorks (a real time embedded operation system). Our software runs multi-...
2
votes
0answers
207 views

Have any C compilers ever *defined* `unsigned short x=-3; x*=x;` to yield anything other than 9

In a C implementation where int can hold all values of type unsigned short, standard integer promotion rules dictate that given the code: unsigned short x=(USHORT_MAX+1)-3; // Or just -3 x*=x; a ...
2
votes
0answers
661 views

using flat file vs sqlite db for frequent data grabbing in a cron job

I have some automated task to be done using certain types of logs generated on the server end of each day. Log files contains specific machine identification "MAC" that is to be re-written in to ...
1
vote
0answers
94 views

How to use an enumeration type, when the values are not known at first?

We have a project, that consists of a cluster of C source code, a C library and a C++ library. The C++ library is dependent only upon the C library, or at least that is what I am trying to achieve. ...
1
vote
0answers
333 views

In-place merging of sorted intervals in an array?

So I have code producing k sorted intervals in an n-sized array. What I'm brainstorming is the possibility of in-place merge of these intervals into a single sorted interval/array. The problem is ...
1
vote
0answers
411 views

How does a dynamic library's references to a static variable get translated once in the running app?

If a dynamic library exports the address to a global variable defined within the library, how are accesses to that variable translated during dynamic linking so that a running application can interact ...
0
votes
0answers
21 views

Emscripten - passing command line arguments

I have a C program "translated" (dont know what word is appropiate) to Javascript, so I can use it in node.js. C program consists of main that accepts command line parameters. I understand that I need ...
0
votes
0answers
54 views

Converting a 1D character array to a 2D array in random order.

I define my character array (9 items) as the following: char arr[] = {'a', 'c', 'b', 'z', 'k', 'l', 'j', 'o', 'd'} From this array, I would like to create a 3x3 array, in which the characters are ...
0
votes
0answers
48 views

GUI - engine data exchange, design with C, getters or struct pointers passing?

Having quite big codebase and external libraries, in C application, what would be pros and cons of two approaches (or suggest other): (assume that there are NONE api provided calls for this) Edit ...
0
votes
0answers
73 views

A callback for when data is received?

So, my understanding is that the Kernel could receive TCP at any time, and that generally a C program asks the Kernel synchronously/asynchronously if it has data available. Would it be possible for a ...
0
votes
0answers
122 views

GMP Core Dump while using mpz_clear in C

I'm working on a prime factorization program written in C using the GMP library through cygwin. The algorithm that I have now works fine, but has memory leaks from not using the mpz_clear function on ...
0
votes
0answers
617 views

Best way to signal all child processes to terminate using C

I have been assigned the task of designing a simple web server using C in my UNIX & C class. The webserver listens and forks when a successful connection is made so that multiple clients may be ...
0
votes
0answers
97 views

Abstract Web API from validation and configuration management in embedded system

Im working with embedded Linux for a router. There is a web GUI for the user to configure router options. When user fill a web form this is submitted to a web server function that is responsible of ...
0
votes
0answers
335 views

Writing Z80 table based assembler/disassembler

I have a long-term project: DIY computer with various processors. One of my wishes not only make hardware, but software too. So I started from assembler/disassembler for Linux, though there is a lot ...
0
votes
0answers
96 views

Does multiple Bloom filters make sense?

In order to decrease the number of false positives, I came up with a couple of possible solutions. Create two different types of Bloom filters; eg. filter1 using 3 different hash algorithms, filter2 ...