Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- strlen.c ---
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char word2[256] = {'1', '2', '3', '4'};
- printf("word2 = %s, strlen(word2) = %d", word2, strlen(word2));
- return 0;
- }
- --- fordítás ---
- gcc -Wall -ansi -pedantic -fno-builtin -g strlen.c
- --- futtatás ---
- word2 = 1234, strlen(word2) = 4
- --- debug ---
- gdb ./a.out
- (start, next, next)
- (gdb) print word2
- $1 = "1234", '\000' <repeats 251 times>
- (gdb) print strlen(word2)
- $2 = 1742576
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement