diff options
author | antirez <antirez@gmail.com> | 2014-02-06 16:44:25 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-02-06 16:44:25 +0100 |
commit | c135fed2f965bf73b7672e86d85ff8bf5f740a4c (patch) | |
tree | 040deac2dd64bcf7ecd464531a2d0845fe16bf04 | |
parent | 2a45d226587e1fc456e8213a897ee5369c0d072c (diff) | |
download | sds-c135fed2f965bf73b7672e86d85ff8bf5f740a4c.tar.xz |
Two examples fixed.
-rw-r--r-- | README.md | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -275,14 +275,14 @@ Because `sdscatprintf` is actually a function that concatenates strings all you need is to concatenate your string to an empty string: char *name = "Anna"; - int age = 2500; + int loc = 2500; sds s; - s = sdscatprintf(sdsempty(), "%s wrote %d lines of LISP\n", name, age); + s = sdscatprintf(sdsempty(), "%s wrote %d lines of LISP\n", name, loc); You can use `sdscatprintf` in order to convert numbers into SDS strings: int some_integer = 100; - sds num = sdscatprintf(sdsempty(),"%s\n", some_integer); + sds num = sdscatprintf(sdsempty(),"%d\n", some_integer); However this is slow and we have a special function to make it efficient. |