Einzelnen Beitrag anzeigen

elyesa

Registriert seit: 15. Apr 2005
8 Beiträge
 
#1

Bitte um Hilfe [C++ -> Delphi]

  Alt 3. Mär 2010, 14:59
hallo,
brauche hilfe um diese funktion in delphi umzuwandeln. jedoch habe ich keine ahnung von c++.

Code:
//strstr without case
char* stristr(const char *String, const char *Pattern)
{
      char *pptr, *sptr, *start;

      for (start = (char *)String; *start != NULL; start++)
      {
            /* find start of pattern in string */
            for ( ; ((*start!=NULL) && (toupper(*start) != toupper(*Pattern))); start++)
                  ;
            if (NULL == *start)
                  return NULL;

            pptr = (char *)Pattern;
            sptr = (char *)start;

            while (toupper(*sptr) == toupper(*pptr))
            {
                  sptr++;
                  pptr++;

                  /* if end of pattern then pattern was found */

                  if (NULL == *pptr)
                        return (start);
            }
      }
      return NULL;
}
wäre echt super wenn mir jemand helfen könnte.
  Mit Zitat antworten Zitat