Top "Pointers" questions

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

How to convert const char* to char* in C?

In my project there is a method which only returns a const char*, whereas I need a char* string, as …

c pointers const-char
lvalue required as left operand of assignment error when using C++

int main() { int x[3]={4,5,6}; int *p=x; p +1=p;/*compiler shows error saying lvalue required as left operand of assignment*/ …

c++ pointers required lvalue
NULL vs nullptr (Why was it replaced?)

I know that in C++ 0x or NULL was replaced by nullptr in pointer-based applications. I'm just curious of the …

c++ pointers null nullptr
Is it safe to delete a NULL pointer?

Is it safe to delete a NULL pointer? And is it a good coding style?

c++ pointers memory-management null-pointer delete-operator
constant pointer vs pointer on a constant value

What is the difference between the following declarations? char * const a; const char * a; In order to understand the difference …

c pointers constants
Why does the arrow (->) operator in C exist?

The dot (.) operator is used to access a member of a struct, while the arrow operator (->) in C …

c pointers dereference
Pointer-to-pointer dynamic two-dimensional array

First timer on this website, so here goes.. I'm a newbie to C++ and I'm currently working through the book "…

c++ arrays pointers memory-management dynamic-arrays
Pointer to class data member "::*"

I came across this strange code snippet which compiles fine: class Car { public: int speed; }; int main() { int Car::*pSpeed = &…

c++ class pointers c++-faq
error: ‘NULL’ was not declared in this scope

I get this message when compiling C++ on gcc 4.3 error: ‘NULL’ was not declared in this scope It appears and …

c++ gcc pointers null