Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to compare the sizes of integer variables and character types in C language
How to compare the sizes of integer variables and character types in C language
You can compare directly,

Because each character has a numerical value in the ASCII table ("A"-"Z" [65-90], "A"-"Z" [97-122]),

Other ASCII references to this table, examples are as follows:

int a;

char str = ' A

scanf("%d ",& ampa);

If (a & gtstr){

Printf ("Really! \ n ");

} Otherwise {

Printf ("Fake! \ n ");

}

You can also use the atoi(char *) function, which can convert characters into shapes.

For example:

void main()

{

int a;

char b;

If (a> Attoy (b))

{

... (your code)

}

}