Commit 5dbc7d69 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add sscanf %i test

parent b6499d4d
#include <stdio.h>
bool check(const char *t, int nres)
{
int n;
sscanf(t, "%i", &n);
printf("res=%d\n", n);
if ( n != nres)
printf("FAILED\n");
return n == nres;
}
int main()
{
check("100",100);
check("0x100",0x100);
check("0XFF",0xff);
// check(NULL,0); // SegFault
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment