Stringliteral: Wird nochmal \0 angehängt, wenn letztes Zeichen schon \0 ist?



  • Hi!

    Wird bei einem Stringliteral nochmals ein \0 Zeichen angehängt, auch wenn das letzte Zeichen eh schon \0 ist?

    zB:

    openFileName.lpstrFilter = "Log Files ( *.lf )\0*.lf\0\0";
    

    MSDN sagt nämlich:

    MSDN schrieb:

    OPENFILENAME Structure
    lpstrFilter
    Pointer to a buffer containing pairs of null-terminated filter strings. The last string in the buffer must be terminated by two NULL characters.

    Reicht es da jetzt, wenn ich am Ende doch nur einmal \0 schreibe, da dann eh noch einmal \0 angehängt wird, oder wird eben kein \0 mehr automatisch angehängt?

    MfG



  • nein musst nur einmal \0 anhängen. Der Compiler hängt in jedem Fall noch ein \0 an


Anmelden zum Antworten