/*It is possible to use martingale probability theory to beat some gamesof chance. In a fair game of coin toss, where the odds reach anequilibrium of 50/50 chain reactions do occur. This can be explainedusing martingale probability theory, but in simpler terms it only showsan example of how orde...
Dear lovely moderator, please allow me to spread this information,somebody might need it, please forgive me if you are botheredDear All, this might be useful for you and your familyI have already use it and prove that my family health is now very muchimprove,no more headache, no more back pain,...
I'm working with some legacy C code. Apparently the author didn't knowor care about the difference between int, int16_t, unsigned int, and soon. He does a lot of bitwise |, &, etc on signed int, without regard tothe size of int and sign flipping. The result is that the code producesval...
It is possible to use martingale probability theory to beat some gamesof chance. In a fair game of coin toss, where the odds reach anequilibrium of 50/50 chain reactions do occur. This can be explainedusing martingale probability theory, but in simpler terms it only showsan example of how order...
According to 7.20.4.5 of n869, system() can report whether the hostenvironment has a command processor (when passed a null pointer)., if there is a command processor, non-null string argumentsto system() are passed to it. However, the text doesn't specificallystate what occurs when there is...
Hi all,maybe it's an old question, but I couldn't find an answerlet's say I have this kind of directory structure for project foo:/foo/includes/mod1.h (exported by mod1)/foo/includes/mod2.h (exported by mod2)/foo/mod1/file1.c/foo/mod1/file1.h (exported by file1)/foo/mod1/file2.c/f...
If I have an array of int:int array[8];I suppose the correct way to clear it using memset() would be:memset(array, 0, 8 * sizeof(int));However, I've seen the following in a piece of code:memset(&array, 0, 8 * sizeof(int));What does (or shall) the compiler do in this case? Is the behaviour d...
Hi there,There's a classic hash function to hash strings, where MULT is definedas "31"://from programming pearlsunsigned int hash(char *ptr){unsigned int h = 0;unsigned char *p = ptr;int n;for (n = k; n 0; p++) {h = MULT * h + *p;if (*p == 0)n--;}return h % NHASH;}Why MULT defined as 31? (...
Hi guys,We have the following macro:#define NEXT(type,p) (*((type*)(p))++)It provides a way to poke variable sized data into an array of pcodefor a simple VM.e.g,NEXT(byte,pcode) = PUSH;NEXT(int,pcode) = constant;But this technique now seems to be deprecated. It seems fairly safe tome (pointers...
Something I don't really understand.In , Insert and Delete for linked listare defined as:int Insert(node **head, int data)andint Delete(node** head, int deleteMe)I thought linked-list is always defined as something like struct node*head. Why the author defined the linked-list as pointer to...
Hi all,I have the following code ,#include <stdio.h>#define f(a,b) a##b#define g(a) #aint main(void){printf("%s\n",g(f(10,20)));return 0;} that i got isf(10,20)But i expected1020My assumption was1) first f(10,20) is replaced by 1020 , because of macro f(a,b)concantenates its arguments2) th...
Hi all,I'm doing a small c program which backs up the mbr of hard disk.Currently working in linux.what i did was :system("sudo dd if=/dev/sda of=mbr.bin bs=512 count=1");This is the output i got from console.1+0 records in1+0 records out512 bytes (512 B) copied, 7.6e-05 seconds, 6.7 MB/sis...

