“Be a pointer, my friend”
23 noviembre 2006
Versión en C:
Empty your memory,
with a free()….
like a pointer!
If you cast a pointer to a integer,
it becomes the integer,
if you cast a pointer to a struct,
it becomes a struct….
The pointer can crash…,
and can Overflow…
Be a pointer my friend….
Versión en C++:
Empty your mind,
be formless,
shapeless – like void*.
If you put an int into a void*,it becomes the int.
You put float into a void* it becomes the float.
You put in a char it becomes the char.
Now, void* can flow or it can overflow.
Be void*, my friend.
Y cómo no, una versión para Windows:


Un comentario de ““Be a pointer, my friend””
01
Oleeeeeee! iba a ponerlo yo en mi blog pero vamos… me has rebentado la idea. De todas formas la versión C++ *NO* tiene gracia, oh si?…
Tendría que haber sido algo más como….
Empty your mind,
be formless,
shapeless – like templates
if you put an int into a template, it becomes the int.
if you put an float into a template, it becomes the float.
templates can be specialized,
or can generate code,
Be template, my friend.
Un abrazo!
Al habla