/
githubmirror
/
glibc
Обзор
Документация
Войти
/
githubmirror
/
glibc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
stdio-common/scanf9.c
30 строк
566 B
Andreas Jaeger
Update.
15 дек 2000, 19:03
15 дек 2000, 19:03
1a511d3
Код
Авторство
О чём код?
#include <stdio.h> #include <stdlib.h> #include <string.h> int main (void) { int matches; char str[10]; str[0] = '\0'; matches = -9; matches = sscanf ("x ]", "%[^] ]", str); printf ("Matches = %d, string str = \"%s\".\n", matches, str); printf ("str should be \"x\".\n"); if (strcmp (str, "x")) abort (); str[0] = '\0'; matches = -9; matches = sscanf (" ] x", "%[] ]", str); printf ("Matches = %d, string str = \"%s\".\n", matches, str); printf ("str should be \" ] \".\n"); if (strcmp (str, " ] ")) abort (); return 0; }