Top "Pointers" questions

Data type that "points to" another value stored in memory.

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
Why aren't pointers initialized with NULL by default?

Can someone please explain why pointers aren't initialized to NULL? Example: void test(){ char *buf; if (!buf) // whatever } The program …

c++ memory pointers initialization
C: Cannot initialize variable with an rvalue of type void*

I have the following code: int *numberArray = calloc(n, sizeof(int)); And I am unable to understand why I receive …

c pointers variable-initialization
Using the equality operator == to compare two strings for equality in C

int main (int argc, **argv) { if (argv[1] == "-hello") printf("True\n"); else printf("False\n"); } # ./myProg -hello False Why? I …

c string pointers equality equality-operator
Converting Char * to Uppercase in C

I'm trying to convert a char * to uppercase in c, but the function toupper() doesn't work here. I'm trying to …

c string pointers strtok
Declaring pointers; asterisk on the left or right of the space between the type and name?

Possible Duplicates: What makes more sense - char* string or char *string? Pointer declarations in C++: placement of the asterisk …

c++ c pointers
How to understand the pointer star * in C?

I'm struggling with the pointer sign *, I find it very confusing in how it's used in both declarations and expressions. …

c pointers dereference
What is a dangling pointer?

I know this is pretty common question, but still new for me! I don't understand concept of dangling pointer, was …

c++ pointers dangling-pointer
char and char* (pointer)

I would like to understand how pointers work, so i created this small program. first of all i create a …

c++ pointers char dereference type-mismatch
Copy constructor with pointers

I have recently discovered that when I have pointers within a class, I need to specify a Copy constructor. To …

c++ pointers copy-constructor