summaryrefslogtreecommitdiff
path: root/tests/core/test_strtoll_bin.in
blob: cbe5546f99f9861d989ba8cb08813960e0e9cc91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <stdlib.h>

int main() {
  const char *STRING = "1 -101 +1011";
  char *end_char;

  // defined base
  long long int l4 = strtoll(STRING, &end_char, 2);
  long long int l5 = strtoll(end_char, &end_char, 2);
  long long int l6 = strtoll(end_char, NULL, 2);

  printf("%d%d%d\n", l4 == 1, l5 == -5, l6 == 11);
  return 0;
}