Histoire des pointeurs
ALGOL
ALGOL-60 n'avait pas de pointeurs explicites mais avait passage par valeurs VS passage par références VS passage par nom.
En ALGOL-60, par défaut = par référence
procedure Swap(x, y);
integer x, y;
begin integer t;
t := x;
x := y;
y := t;
end
i = 1;
A[1] := 3;
A[2] := 2;
A[3] := 5;
Swap(i, A[i]);
- Par référence, A =
1 2 5etivaut 3.
Le passage par référence est disponible en Pascal avec var :
procedure Swap(var A, B: Integer);
var
Temp: Integer;
begin
Temp := A;
A := B;
B := Temp;
end;
Le passage par référence n'existe pas en C (on utilise des pointeurs), mais existe en C++ avec des références.
Par valeur
procedure Swap(x, y);
value x, y;
integer x, y;
begin integer t;
t := x;
x := y;
y := t;
end
i = 1;
A[1] := 3;
A[2] := 2;
A[3] := 5;
Swap(i, A[i]);
- Par valeur, rien ne change : A =
3 2 5etivaut 1.
En C, tout est passé par valeur.
Par nom
procedure Swap(x, y);
name x, y;
integer x, y;
begin integer t;
t := x;
x := y;
y := t;
end
i = 1;
A[1] := 3;
A[2] := 2;
A[3] := 5;
Swap(i, A[i]);
- Par nom, A =
1 2 1etivaut 3.
Le passage par nom est une catastrophe... Il a été abandonné dans d'autres langages.
https://www.cs.csustan.edu/~mmartin/teaching/CS4100S11/lectures/Algol_Part4.pdf </!-->
Premiers languages avec pointeurs

Kateryna L. Yushchenko (URSS) est créditée comme la créatrice des pointeurs en 1955 quand elle a conçu Address Programming Language (Адресна мова програмування). On trouve peu d'informations sur ce langage.
Harold Lawson (USA) est crédité comme créateur des pointeurs en 1964 pour le langage PL/I (Programming Language One).
Un exemple de code ici : https://www.ibm.com/docs/en/zos/2.4.0?topic=services-pli-example-building-linked-list. On y déclarait un pointeur P comme suit :
DCL P POINTER;
Cf. https://www.ibm.com/docs/en/zos/3.1.0?topic=services-ceegtstget-heap-storage l'allocation mémoire fonctionne comme suit :
CALL CEEGTST ( HEAPID, NBYTES, ADDRSS, FC );
où CEEGTST est le nom du service pour allouer de la mémoire sur un tas. Il y a plusieurs tas : on donne l'ID du tas où on veut allouer dans HEADID. Le paramètre NBYTES indique le nombre d'octets. Le paramètre ADDRSS est modifié avec l'adresse vers la zone allouée. FC reçoit lui le feedback code (est-ce que l'allocation a réussi ? etc.).
Pointeur nul : erreur à 1 000 000 000$
C. A. R. Hoare a dit en 2009 :
I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.