gdb tested ;)

This commit is contained in:
mpabi 2024-05-25 20:12:41 +00:00
parent fa96a5d3b9
commit a0f7585ae1
1 changed files with 4 additions and 1 deletions

View File

@ -131,6 +131,7 @@ int alg(char *ptr) {
char *token = simple_strtok(ptr, delims);
while (token != (char *)NULL) {
p[pos].ptr = token;
p[pos].len = strlen(token);
++pos;
token = simple_strtok((char *)NULL, delims);
@ -138,7 +139,9 @@ int alg(char *ptr) {
return pos;
}
// gdb: p/x (model[]*)p[0].len
// gdb: p/s (char *)(model[]*)p[2].ptr
// :) powered by rv32i
int main() {
char *str = " Success is often defined as the ability to reach your goals in life, whatever those goals may be. In some ways, a better word for success might be attainment, accomplishment, or progress. It is not necessarily a destination but a journey that helps develop the skills and resources you need to thrive.";
alg(str);