segmentation fault : 11

This declaration: would occupy 8 * 1000 * 1000000 bytes on a typical x86 system. This is about 7.45 GB. Chances are your system is running out of memory when trying to execute your code, which results in a segmentation fault.

What causes the Broken Pipe Error?

It can take time for the network close to be observed – the total time is nominally about 2 minutes (yes, minutes!) after a close before the packets destined for the port are all assumed to be dead. The error condition is detected at some point. With a small write, you are inside the MTU … Read more

Convert an int to ASCII character

Straightforward way: Safer way: Generic way: Handy way: C++ way: (taken from Dave18 answer) Boss way: Joe, write me an int to char converter Studboss way: char aChar = ‘6’; Joe’s way: char aChar = ‘6’; //int i = 6; Nasa’s way: //Waiting for reply from satellite… Alien’s way: ‘9’ //Greetings. God’s way: Bruh I built … Read more

What does \0 stand for?

Possible Duplicate:What does the \0 symbol mean in a C string? I am new at iPhone Development. I want to know, what does ‘\0’ means in C, and what is the equivalent for that in objective c.

How do function pointers in C work?

Function pointers in C Let’s start with a basic function which we will be pointing to: First thing, let’s define a pointer to a function which receives 2 ints and returns an int: Now we can safely point to our function: Now that we have a pointer to the function, let’s use it: Passing the … Read more

max value of integer

In C, the language itself does not determine the representation of certain datatypes. It can vary from machine to machine, on embedded systems the int can be 16 bit wide, though usually it is 32 bit. The only requirement is that short int <= int <= long int by size. Also, there is a recommendation that int should represent the native capacity of the processor. All types … Read more

Difference between malloc and calloc?

calloc() gives you a zero-initialized buffer, while malloc() leaves the memory uninitialized. For large allocations, most calloc implementations under mainstream OSes will get known-zeroed pages from the OS (e.g. via POSIX mmap(MAP_ANONYMOUS) or Windows VirtualAlloc) so it doesn’t need to write them in user-space. This is how normal malloc gets more pages from the OS as well; calloc just takes advantage of the OS’s guarantee. This means calloc memory … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)