Updated slice examples to show string is not required to be mutable
This commit is contained in:
parent
48218b0cdb
commit
52d7e8a1c2
2 changed files with 2 additions and 8 deletions
|
|
@ -1,13 +1,12 @@
|
|||
#define LAZY_IMPL
|
||||
#include "../lazy.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int isnotalpha(int x) { return !isalpha(x); }
|
||||
|
||||
int main() {
|
||||
char *src = lz_cstr_dup("This is a list of words, which apparently has been referred to previously as a sentence");
|
||||
char *src = "This is a list of words, which apparently has been referred to previously as a sentence";
|
||||
Lz_Slc s = lz_cstr_to_slc(src);
|
||||
|
||||
Lz_Slc word;
|
||||
|
|
@ -18,8 +17,5 @@ int main() {
|
|||
++i;
|
||||
} while(s.cnt != 0);
|
||||
|
||||
free(src);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue