tst_strrchr.c
来自「这是《Keil Cx51 V7.0单片机高级语言编程与uVision2应用实践》」· C语言 代码 · 共 19 行
C
19 行
#include <string.h>
#include <stdio.h> /* for printf */
void tst_strrchr (void) {
char *s;
char buf [] = "This is a test";
s = strrchr (buf, 't');
if (s != NULL)
printf ("found the last 't' at %s\n", s);
}
void tst_strrpos ( char *s) {
int i;
i = strpos (s, ' ');
if (i == -1)
printf ("No spaces found in %s\n", s);
else
printf ("Last space in %s is at offset %d\n", s, i);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?