Autore Topic: Convertire puntatori a stringhe (prendendo il valore numerico del puntatore)  (Letto 415 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.270
  • Ne mors quidem nos iunget
    • Mostra profilo
Riporto di seguito una discussione posta nella Mailing List Internazionale:


« What's the point to be able to convert pointers to strings (take the numerical value of the pointer)?
If I would like a string representation of a pointer I would at least want it in hexadecimal form.
But I also think most people that convert pointers to strings want to get the string out of a char* that points to a NULL-terminated string.

Emil Lenngren
»



« It's just some sort of shortcut:
CStr(pointer) = CStr(CInt(pointer)) or CStr(CLong(pointer)) according to the size of the pointer.

I found that logical, so that a Pointer can be directly used as a Collection key.

But I agree that using hexadecimal would be better.

Regards,

--
Benoît Minisini
»
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »