9a9b91c940
It's finally done.. Signed-off-by: kaguya <vpshinomiya@protonmail.com>
12 lines
230 B
C
12 lines
230 B
C
#include <strings.h>
|
|
#include <assert.h>
|
|
|
|
int main() {
|
|
char str[] = "This is a sample string";
|
|
char *pch;
|
|
pch = rindex(str, 's');
|
|
// The last occurence of 's' is at position 18
|
|
assert(pch - str + 1 == 18);
|
|
return 0;
|
|
}
|