#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define NUM 111
int main()
{
char a1 = 0xf8;
printf("%d\n", a1);
//-8
char a[] = "100";
char b[] = "100";
char c[] = "0x11";
int x, y, z;
x = strtol(a, NULL, 10);
y = strtol(b, NULL, 2);
z = strtol(c, NULL, 16);
printf("x = %d\n", x);
printf("y = %d\n", y);
printf("z = %d\n", z);
system("pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define NUM 111
int main()
{
char a1 = 0xf8;
printf("%d\n", a1);
//-8
char a[] = "100";
char b[] = "100";
char c[] = "0x11";
int x, y, z;
x = strtol(a, NULL, 10);
y = strtol(b, NULL, 2);
z = strtol(c, NULL, 16);
printf("x = %d\n", x);
printf("y = %d\n", y);
printf("z = %d\n", z);
system("pause");
return 0;
}