Skip to content
Discussion options

You must be logged in to vote

Yes, those functions are basically initializing the string (alias buffer) struct without copying anything.
So, this:

typedef struct buffer
{
    umw Count;   // strength length
    u8* Data;    // the string data
} buffer, string;

StringZ is creating the struct initialization at compile time. This should only be used for literals. I am actually going to rename this now to make it clearer.
StringZFunc creates it at runtime because there is a function call happening.

Both simply take a string argument. One should be used for literals while the other could be used for runtime strings.

The Z in the name is to indicate that it handles zero-terminated strings, that means a string that is termin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btgvesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants