Top "C" questions

C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform.

srand() — why call it only once?

This question is about a comment in this question Recommended way to initialize srand? The first comment says that srand() …

c random srand
Proper Way To Initialize Unsigned Char*

What is the proper way to initialize unsigned char*? I am currently doing this: unsigned char* tempBuffer; tempBuffer = ""; Or should …

c++ c char unsigned
Is an array name a pointer?

Is an array's name a pointer in C? If not, what is the difference between an array's name and a …

c arrays pointers
Why the range of int is -32768 to 32767?

Why the range of any data type is greater on negative side as compare to positive side? For example, in …

c visual-studio int turbo-c
Casting a void pointer to a struct

I started feeling comfortable with C and then I ran into type casting. If I have the following defined in …

c casting void
understanding requirements for execve and setting environment vars

We are having a lot of trouble interpreting our teacher. We asked for clarification and got the following back from …

c path exec execve
strcpy vs strdup

I read that strcpy is for copying a string, and strdup returns a pointer to a new string to duplicate …

c strcpy strdup
Set local environment variables in C++

How do I set an environment variable in C++? They do not need to persist past program execution They only …

c++ c manpage
Is it good practice to free a NULL pointer in C?

Possible Duplicate: Does free(ptr) where ptr is NULL corrupt memory? I'm writing a C function that frees a pointer …

c pointers memory-management
How do I gaussian blur an image without using any in-built gaussian functions?

I want to blur my image using the native Gaussian blur formula. I read the Wikipedia article, but I am …

c image-processing gaussianblur