Add example of formatted C string for string in M_LET

This commit is contained in:
Patrick Pelissier committed 2020-05-21 11:55:35 +02:00
1 parent ce2adea6c0
commit 77813adc00
1 file changed
+4
+4
View File
@@ -20,6 +20,10 @@ int main(void)
// Also add a space character
string_push_back(str, ' ');
}
// Let's define another string and set it to a formatted value.
M_LET( (count, "\nTo display this it uses \"vector\" of %zu strings!", vector_string_size(msg)), string_t) {
string_cat(str, count);
}
// Print the result
printf("%s\n", string_get_cstr(str) );
}