Home > Back-end >  Posting really someone back?
Posting really someone back?

Time:09-16

How to solve this? Also, how about c1=% c into a single character?

CodePudding user response:

The compiled output results are as follows:
c1=a, c2=b
C1=97, c2=98


Firstly, c1 and c2 is character type and assignment for 97 and 98 respectively

Printf (" c1=% c, c2=% c \ n ", c1, c2);// this line mean the c1 and c2 with output printf () function output character of the way, although the original poster is not for c1 and c2 assignment is what character, but the assignment Numbers 97 and 98, and this involves a call ASCII, certain characters in the ASCII and Numbers are one to one correspondence, corresponding characters and 97 a, 98 b corresponding characters, so the printf output character and character b, I know that the original poster wants to warren, as to why such corresponding? This is a good agreement, why have this thing called ASCII, you can go to baidu encyclopedia, I also just learn C language soon, can't answer too much,

Printf (" c1=% d, c2=% d \ n ", c1, c2);// this line means the c1 and c2 using the printf function in the form of decimal output, the output is 97 and 98,

What they don't understand, please continue to cross-examine,

CodePudding user response:

Why don't you try it yourself? Programming or want to practice more

CodePudding user response:

reference 1st floor weixin_45906870 response:
the compiled output results are as follows:
c1=a, c2=b
C1=97, c2=98


Firstly, c1 and c2 is character type and assignment for 97 and 98 respectively

Printf (" c1=% c, c2=% c \ n ", c1, c2);// this line mean the c1 and c2 with output printf () function output character of the way, although the original poster is not for c1 and c2 assignment is what character, but the assignment Numbers 97 and 98, and this involves a call ASCII, certain characters in the ASCII and Numbers are one to one correspondence, corresponding characters and 97 a, 98 b corresponding characters, so the printf output character and character b, I know that the original poster wants to warren, as to why such corresponding? This is a good agreement, why have this thing called ASCII, you can go to baidu encyclopedia, I also just learn C language soon, can't answer too much,

Printf (" c1=% d, c2=% d \ n ", c1, c2);// this line means the c1 and c2 using the printf function in the form of decimal output, the output is 97 and 98,

What don't understand, please continue to cross-examine,

Super, thank you, if the program/5 lines instead of 4:

C1=197;

C2=198;

Is the results of the output information and "overflow" (the word just heard)? This corresponds to 197-128=69 E, 198-128=70 F

CodePudding user response:

reference 2 building self-confidence boy reply:
why don't you try it yourself? Programming is to practice

Try only know the result, don't know why

CodePudding user response:

reference weixin_47633905 reply: 3/f
Quote: refer to 1st floor weixin_45906870 response:

The compiled output results are as follows:
c1=a, c2=b
C1=97, c2=98


Firstly, c1 and c2 is character type and assignment for 97 and 98 respectively

Printf (" c1=% c, c2=% c \ n ", c1, c2);// this line mean the c1 and c2 with output printf () function output character of the way, although the original poster is not for c1 and c2 assignment is what character, but the assignment Numbers 97 and 98, and this involves a call ASCII, certain characters in the ASCII and Numbers are one to one correspondence, corresponding characters and 97 a, 98 b corresponding characters, so the printf output character and character b, I know that the original poster wants to warren, as to why such corresponding? This is a good agreement, why have this thing called ASCII, you can go to baidu encyclopedia, I also just learn C language soon, can't answer too much,

Printf (" c1=% d, c2=% d \ n ", c1, c2);// this line means the c1 and c2 using the printf function in the form of decimal output, the output is 97 and 98,

What don't understand, please continue to cross-examine,

Super, thank you, if the program/5 lines instead of 4:

C1=197;

C2=198;

Is the results of the output information and "overflow" (the word just heard)? Such corresponding E 197-128=69, 198-128=70 corresponding F
overflow the concept of the building Lord had better don't delve into, this involves the binary operations, in order to understand clearly must learn computer composition principle of the original code, complement, radix-minus-one complement and other related knowledge, and if you want to speak here is going to type too much words, you now have one impression is good, really want to know is to supplement the relevant knowledge of computer composition principle,

CodePudding user response:

reference 4 floor weixin_47633905 response:
Quote: refer to the second floor confident boy reply:

Why don't you try it yourself? Programming is to practice

Try only know the result, don't know why

Through the results won't back? Why will output the result, can add some debug information, such as how hexadecimal format said, what is the binary, etc

CodePudding user response:

reference 5 floor weixin_45906870 reply:
Quote: refer to the third floor weixin_47633905 response:
Quote: refer to 1st floor weixin_45906870 response:

The compiled output results are as follows:
c1=a, c2=b
C1=97, c2=98


Firstly, c1 and c2 is character type and assignment for 97 and 98 respectively

Printf (" c1=% c, c2=% c \ n ", c1, c2);// this line mean the c1 and c2 with output printf () function output character of the way, although the original poster is not for c1 and c2 assignment is what character, but the assignment Numbers 97 and 98, and this involves a call ASCII, certain characters in the ASCII and Numbers are one to one correspondence, corresponding characters and 97 a, 98 b corresponding characters, so the printf output character and character b, I know that the original poster wants to warren, as to why such corresponding? This is a good agreement, why have this thing called ASCII, you can go to baidu encyclopedia, I also just learn C language soon, can't answer too much,

Printf (" c1=% d, c2=% d \ n ", c1, c2);// this line means the c1 and c2 using the printf function in the form of decimal output, the output is 97 and 98,

What don't understand, please continue to cross-examine,

Super, thank you, if the program/5 lines instead of 4:

C1=197;

C2=198;

Is the results of the output information and "overflow" (the word just heard)? Such corresponding E 197-128=69, 198-128=70 corresponding F
overflow the concept of the building Lord had better don't delve into, this involves the binary operations, in order to understand clearly must learn computer composition principle of the original code, complement, radix-minus-one complement and other related knowledge, and if you want to speak here is going to type too much words, you now have one impression is good, really want to know is to supplement the relevant knowledge of computer composition principle,

Thank you, understand now

CodePudding user response:

reference 6 building self-confidence boy reply:
Quote: refer to 4th floor weixin_47633905 response:

The
Quote: 2 reference building self-confidence boy reply:

Why don't you try it yourself? Programming is to practice

Try only know the result, don't know why

Through the results won't back? Why will output the result, can add some debug information, such as how hexadecimal format said, what is the binary, and so on


Thank you, now will play

CodePudding user response:

% c is used to output characters
  • Related