15 lines
332 B
C
15 lines
332 B
C
#include <assert.h>
|
|
#include <string.h>
|
|
|
|
extern void sort_strings(const char * input, char * output, unsigned int n);
|
|
|
|
int main() {
|
|
char buf[100];
|
|
sort_strings("ciao", buf, 1);
|
|
assert(memcmp(buf, "ciao", 5) == 0);
|
|
|
|
sort_strings("ciao\0blah", buf, 2);
|
|
assert(memcmp(buf, "blah\0ciao", 10) == 0);
|
|
|
|
return 0;
|
|
}
|