Einzelnen Beitrag anzeigen

Benutzerbild von Mystic
Mystic

Registriert seit: 18. Okt 2003
Ort: Flerzheim
420 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: C nach Delphi übersetzen

  Alt 10. Jun 2006, 14:41
Zitat von turboPASCAL:
Leider werde ich aus dem Code nicht schlau was die Funktion macht, wer kann helfen ?
Vielleicht hilft das:

Zitat:
Code:
char *strtok(char *s1, const char *s2);
If s1 is not a null pointer, the function begins a search of the string s1. Otherwise, it begins a search of the string whose address was last stored in an internal static-duration object on an earlier call to the function, as described below. The search proceeds as follows:

The function searches the string for begin, the address of the first element that equals none of the elements of the string s2 (a set of token separators). It considers the terminating null character as part of the search string only.

If the search does not find an element, the function stores the address of the terminating null character in the internal static-duration object (so that a subsequent search beginning with that address will fail) and returns a null pointer. Otherwise, the function searches from begin for end, the address of the first element that equals any one of the elements of the string s2. It again considers the terminating null character as part of the search string only.

If the search does not find an element, the function stores the address of the terminating null character in the internal static-duration object. Otherwise, it stores a null character in the element whose address is end. Then it stores the address of the next element after end in the internal static-duration object (so that a subsequent search beginning with that address will continue with the remaining elements of the string) and returns begin.
Es scheint sich um eine Suchfunktion zu handeln, die anscheinend dazu dient, Strings an gegebenen Zeichen zerlegen zu können.
Jan Steffens
Der Fachwortgenerator - 100% Schwachsinn --- Der UPnP Router Manager - Kommentare erwünscht!
  Mit Zitat antworten Zitat