What is the closest thing windows has to fork()?
I guess the question says it all. I want to fork on windows. What is the most similar operation and how do I use it. ...
I guess the question says it all. I want to fork on windows. What is the most similar operation and how do I use it. ...
If I want to expand a C macro, what are some good ways to do that (besides tracing it manually)? For instance, GTK_WIDGET_SET_FLAGS, it uses a macro that uses a macro that uses a macro (or two) ... I want to just see it somehow expanded automagically, instead of searching for every macro, every step of the way. UPDATE I tried cpp, bu...
Some Duplicates: 1.265 * 10000 = 126499.99999999999 ????? How is floating point stored? When does it matter? Strange floating-point behaviour in a Java program Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? Error in Flash addition I divide 23 by 40 (23/40). In C this operation res...
When attempting to compile mpd with Sun Studio compiler: "client.c", line 438: warning: implicit function declaration: typeof I tracked down the offending lines of code, in dlist.h: #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ ...
When I connect a library to my program, Eclipse doesn't generate any executable file, I get only an object file. When I disconnect the library from my program (delete all paths and library functions), I get an executable. However, I don't get any error in the first case. What is going wrong? I work with: Linux, C, Eclipse. Log: ** ...
Possible Duplicate: Malloc thread-safe? I heard that glibc malloc() was not thread safe, since several threads of a process calling malloc() simultaneously will lead to undefined behaviour. And my question is if a thread calls free() will another thread is calling malloc(), will this lead to undefined behaviour as well? ...
I'm trying to have a debugging mode on so if #define DEBUG 1 I want to printf some variable values and if #define DEBUG 0 I want them off. The problem is I have many implementation files and I want this DEBUG variable to be available for the whole project. Right now I need to edit the DEBUG variable in foo1.c, foo2.c, foo3.c whic...
I have seen it asserted several times now that the following code is not allowed by the C++ Standard: int array[5]; int *array_begin = &array[0]; int *array_end = &array[5]; Is &array[5] legal C++ code in this context? I would like an answer with a reference to the Standard if possible. It would also be interesting to know if it mee...
Is there a way to create a va_list from scratch? I'm trying to call a function that takes a va_list as a parameter: func(void **entry, int num_args, va_list args, char *key); ...from a function that doesn't take a variable number of arguments. The only way I can think of is to create an intermediary function that takes varargs and t...
I need to run an nfsclient on a MIPS target machine, and nfsserver on an x86 machine. Tried to google, but couldn't find an exact solution. Can someone help me with how to compile nfs-utils with target as MIPS? ...
As I loop through lines in file A, I am parsing the line and putting each string (char*) into a char**. At the end of a line, I then run a procedure that consists of opening file B, using fgets, fseek and fgetc to grab characters from that file. I then close file B. I repeat reopening and reclosing file B for each line. What I would ...
I was reading the C Standard the other day, and noticed that unlike signed integer overflow (which is undefined), unsigned integer overflow is well defined. I've seen it used in a lot of code for maximums, etc. but given the voodoos about overflow, is this considered good programming practice? Is it in anyway insecure? I know that a lot ...
Purpose I am writing a small library for a larger project which supplies malloc/realloc/free wrapper-functions as well as a function which can tell you whether or not its parameter (of type void *) corresponds to live (not yet freed) memory allocated and managed by the library's wrapper-functions. Let's refer to this function as isgood_...
Well, I sort of want to have sort of a faint striped pattern across a window... Just, 'cause it'd look nice. Anyways, I know I can just make a hatched brush, like so: however, I can only set the foreground color, and I don't know how to make the background not white (just use the default window color). I was poking around MSDN trying ...
Hi In an object-oriented programming style does how does one tend to handle graphics? Should each object contain its own graphics information? How does that information get displayed? My experience with making graphical programs is limited, but I have tended to have the objects and the graphics be only loosely related. For instance, i...
If the parent form of a (text) static control has a pattern on its background, then the area around the static control is an ugly blotch of solid color. How can I paint the background of the static control with the same pattern that its parent window uses? I've tried this, SetClassLong(retval , GCL_HBRBACKGROUND, (LONG)stripes); w...
I had mounted a fusecompress of directory compressed/ at fusecompress/ I copied a large file (several GB) to the fusecompress directory (ok, I mv'd it). The compressed file in the directory compressed/ is length 1,221,396,660. However, I cannot remove/uncompress the file. fusecompress has a memory error: "Cannot allocate memory". Is the...
Hi, i develop iPhone apps, and after updating to sdk 3.0, I get an error on CFWriteStreamCreateWithFTPURL while linking. This is the code I call to get the error. streamInfo.writeStream = CFWriteStreamCreateWithFTPURL(NULL, urlRefWrite); I have an idea that it can be solved using extern "C", but after having googled it, I have not fou...
I am sending data from a linux application through serial port to an embedded device. In the current implementation a byte circular buffer is used in the firmware. (Nothing but an array with a read and write pointer) As the bytes come in, it is written to the circular bufffer. Now the PC application appears to be sending the data too f...
I'm writing a program with a consumer thread and a producer thread, now it seems queue synchronization is a big overhead in the program, and I looked for some lock free queue implementations, but only found Lamport's version and an improved version on PPoPP '08: enqueue_nonblock(data) { if (NULL != buffer[head]) { return EWO...