Logo

Programming-Idioms

History of Idiom 169 > diff from v48 to v49

Edit summary for version 49 by anonymous:
[C] changed variable name

Version 48

2018-10-01, 12:17:55

Version 49

2018-10-01, 12:18:38

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Imports
#include <string.h>
Imports
#include <string.h>
Code
_n = strlen(_s);
Code
int n = strlen(s);