Home > Back-end >  Please help
Please help

Time:10-09

STRCMP is the size of the how to compare two character strings? Ask about the C language source code examples

CodePudding user response:

 STRCMP (" hello ", "world"); 

It's as simple as that ~

STRCMP is string comparison ~

CodePudding user response:

The
reference 1/f, confident boy reply:
 STRCMP (" hello ", "world"); 

It's as simple as that ~

STRCMP is string comparison ~

The two big small how to determine who who?

CodePudding user response:

Character 1 equal to 2 characters, function value of 0
1> Function values are integers
1<2 function value negative integers

CodePudding user response:

The
reference 3 floor don't know what kind of name, reply:
1 equal to 2 characters, characters function value 0
1> Function values are integers
1<2 function value negative integer

Two Chinese character string who big small C language how to determine?

CodePudding user response:

reference 4 floor qq_45768878 response:
Quote: don't know what kind of name reference 3 floor, response:
characters 1 equal to 2 characters, function value of 0
1> Function values are integers
1<2 function value negative integer

Two Chinese character string who big small C language how to determine?

You to output the value

CodePudding user response:

refer to the second floor qq_45768878 response:
Quote: reference 1/f, confident boy reply:
 STRCMP (" hello ", "world"); 

It's as simple as that ~

STRCMP is string comparison ~

The two big small how to determine who who?

1, 0, 1
1 refers to parameters 1 is less than 2,
Zero mean parameters is equal to 1 2
1 means the parameters 1 is greater than 2.

Use STRCMP, understand its best parameter, the return value, etc

CodePudding user response:

STRCMP is according to each character a string and returns the ASCII value to compare, have nothing to do with whether Chinese
If the first than the second string "big", return 1, two strings are exactly the same returns 0, the first is smaller than the second, return 1
The string "2", than "1342342 SDFDSFSDFS", just because the first character is greater than 1 ASCII value just 2

Details you can see the function prototype
https://baike.baidu.com/item/strcmp/5495571? Fr=Aladdin
Here are detailed explanation, and the simulation code

  • Related