projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
文字列を逆順にするstrrev関数を定義
[YACASL2.git]
/
test
/
unit
/
strrev
/
cmd.c
diff --git a/test/unit/strrev/cmd.c
b/test/unit/strrev/cmd.c
new file mode 100644
(file)
index 0000000..
9c9eba7
--- /dev/null
+++ b/
test/unit/strrev/cmd.c
@@ -0,0
+1,15
@@
+#include <stdio.h>
+#include "cmem.h"
+
+int main()
+{
+ char *src[] = {"abcdefghij", "abcde"};
+ char *dst = NULL;
+
+ for(unsigned i = 0; i < ARRAYSIZE(src); i++) {
+ dst = strrev(src[i]);
+ puts(dst);
+ FREE(dst);
+ }
+ return 0;
+}