Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

diverse Funktionen auf char[ ]

Empfohlene Antworten

Hallo,

ich bräuchte da mal einen Tip von Euch.

Vielleicht habt Ihr ja auch eine fertige Fkt ;-)

Ich lese eine Textdatei zeilenweise ein. Für jede Zeile ein temporäres Array sozusagen. Wie kann ich jetzt alle Leerstellen am Anfang entfernen?

Gruss

:eek:

Da gibts ne Funktion Trimleft und TrimRight, allerdings is die für CString, schau mal in der MSDN nach, da ist auch das Beispiel dafür...

Hmm, also ich habe da so etwas ähnliches geschrieben. Ich ese aus Dateien aus, um dass dann mit etwas zu vergleichen. Wenn es Dich interessiert, dann gib mir mal Deine E-Mail, dann schicke ich Dir das mal, und erkläre da was zu...

Bine

PS: Habe meine Hilfe auch hier bekommen...

hab in der msdn die funktion StrTrim gefunden. die tut in etwa das selbe wie TrimLeft / TrimRight.

Beispiel:


#include <windows.h>

#include <iostream.h>

#include "Shlwapi.h"


void main( void )

{

  //String one

  TCHAR buffer[] = TEXT("_!ABCDEFG#");

  TCHAR trim[] = TEXT("#A!_\0");


  cout  <<  "The string before calling StrTrim: ";

  cout  <<  buffer;

  cout  <<  "\n";


  StrTrim(buffer, trim);


  cout  <<  "The string after calling StrTrim: ";

  cout  <<  buffer;

  cout  <<  "\n";


}


OUTPUT:

- - - - - -

The string before calling StrTrim: _!ABCDEFG#

The string after calling StrTrim: BCDEFG

die funktion löscht die zeichen, die in trim stehen aus dem buffer.

<FONT COLOR="#a62a2a" SIZE="1">[ 22. Oktober 2001 14:29: Beitrag 1 mal editiert, zuletzt von maddin ]</font>

Hallo Maddin,

danke für die antwort.

was ist denn ein tchar? wozu dient die headerdatei "Shlwapi.h"? brauch ich die auch?

Gruss Voklaman

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.