Actual working tests on strspn and strcspn

This commit is contained in:
Tom Almeida
2018-03-14 10:55:01 +08:00
parent cfe98ab3b2
commit b2d01a67f2
2 changed files with 9 additions and 5 deletions
+3 -2
View File
@@ -2,8 +2,9 @@
#include <stdio.h>
int main(int argc, char* argv[]) {
printf("%ld\n", strcspn("hello", "world")); // should be 2
printf("%ld\n", strcspn("banana", "world")); // should be 6
char *world = "world";
printf("%ld\n", strcspn("hello", world)); // should be 2
printf("%ld\n", strcspn("banana", world)); // should be 6
return 0;
}