Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ pointer names

Tags:

c++

pointers

I understand pointers are used to point to objects so you would have to the same around in a program. But were and how are pointer names stored. Would it be an overkill to declare a pointer name that occupies more resource than the object it points to for example:

int intOne = 0;
int *this_pointer_is_pointing_towards_intOne = &intOne;

I know this is a ridiculous example but i was just trying to get the idea across.

Edit: the name of the pointer has to be stored somewhere taking more bytes than the address of the pointed at object.

like image 848
Babiker Avatar asked May 15 '09 20:05

Babiker


1 Answers

The length of the variable name doesn't have any effect on the size of your program, just the length of time it takes to write the program.

like image 157
overslacked Avatar answered Oct 18 '22 16:10

overslacked