Toon posts:

[BC6]Typecast string naar int

Pagina: 1
Acties:
  • 46 views sinds 30-01-2008

Verwijderd

Topicstarter
Het is waarschijnlijk erg triviaal, maar ik wilde weten hoe je van een string naar een int kunt casten. Dus ik heb
AnsiString stringetje = "Hmmm...";
int integertje;
integertje=stringetje;

Op de plaats integertje=stringetje; zou iets van de vorm static_cast<int> moeten komen, tenminste dat dacht ik, maar dat werkte dus ook niet. Welke methode moet ik daar dan wel voor gebruiken? :?

P.S. Ik heb al op Got, bij Borland, en op Google gezocht. (Het zal waarschijnlijk wel ergens bij Google staan, maar ik kon het niet vinden.) :Z

  • MSalters
  • Registratie: Juni 2001
  • Laatst online: 21-08 17:14
Boost heeft boost::lexical_cast<int>

Man hopes. Genius creates. Ralph Waldo Emerson
Never worry about theory as long as the machinery does what it's supposed to do. R. A. Heinlein


  • whoami
  • Registratie: December 2000
  • Laatst online: 29-08 15:58
Heb je de help al eens gebruikt die bij Borland C++ Builder zit?

Je hebt namelijk een functie StrToInt(), kijk daar eens naar...

https://fgheysels.github.io/


  • curry684
  • Registratie: Juni 2000
  • Laatst online: 13-08 16:46

curry684

left part of the evil twins

Of nog stoerder: AnsiString heeft gewoon een member-functie ToInt.
P.S. Ik heb al op Got, bij Borland, en op Google gezocht. (Het zal waarschijnlijk wel ergens bij Google staan, maar ik kon het niet vinden.) :Z
Je mag niet liegen van je moeder... :Z

Professionele website nodig?


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Ze hebben het er bij google afgehaald, want 't stond namelijk in de reference :Z :+

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Dit topic is gesloten.