Implementing simple binary probability distribution.

Using C/C++, I would like the computer to randomly fill some array with either 0s or 1s, in some proportion p. That is, let Array be some n dimensional array. Then, for every i, I want Array[i] = 0 with probability p and = 1 with probability 1-p.

Featured Post

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

Preface
I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…

Summary:
This tutorial covers some basics of pointer, pointer arithmetic and function pointer.
What is a pointer:
A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…