当前位置:网站首页>7-21 wrong questions involve knowledge points.

7-21 wrong questions involve knowledge points.

2022-04-23 18:02:00 OceanKeeper1215

1、 Permission is 765 The file of , The corresponding permission bit is marked as ?

 Linux The permissions on files in are expressed as rwx.  

                   When the permission mark indicates, the first bit indicates the file or directory , For documents - Express , The catalog uses d Express .

                  From the second to the last , Divide every three into a group , Represents the owner of the file , The same group and other users on the file                    Operation permission of .

The answer to this question is to first 765 Expressed as the corresponding binary number , obtain 111110101, Corresponding rwxrw-r-x. Add the first digit to represent the file . The final answer is :-rwxrw-r-x.

 2、 If there are the following procedures

#include <stdio.h>
#define SUB( X,Y ) (X+1)*Y
main( )
{ 
    int a=3,b=4;
    printf( "%d\n" ,SUB( a++ ,b++ ) );
}

The output of the program after running is ? 16

i++ It means to use first i Value Then add it by yourself

++i It means to add... First Use it again i Value

The macro definition is just a simple replacement , perform SUB( a+ + ,b+ + ) =SUB( a+ + +1)*b+ +=16

3、

True value is -100101 The number of words is 8 In the machine of , Its complement form is (11011011).

The original code is :10100101( The word is 8 Machine , There are no eight bytes of data , Therefore, the symbol bit is followed by 0)

4、

One C Language program on a computer 32 Bit machine . Three variables are defined in the program x、y and z, among x and z by int type ,y by short type . When x=127,y=-9 when , Execute assignment statement z=x+y after ,x、y and z The values of

x=0000007FH,y=FFF7H,z=00000076H

C Integer data in the language is in the form of complement ,int by 32 position ,short by 16 position , so x、y Convert to hex 0000007FH、FFF7H. perform z=x+y when , because x yes int type ,y by short type , Short word length data needs to be converted into long word length data , be called “ Symbol extension ”. because y The sign bit of is 1, Therefore, in y Add before 16 individual 1, Can be y Rise to int type , Its hexadecimal form is FFFFFFF7H. Finally, add , namely 0000007FH +FFFFFFF7H=00000076H, The carry of the highest bit 1 Natural discard

5、 Listed below C In language constants , The wrong is ()


U Indicates that the constant is stored as an unsigned integer , amount to unsigned int, namely 1U amount to unsiged int 1; L Indicates that the constant is stored as a long integer , amount to long; F Indicates that the constant is stored in floating-point mode , amount to float

 1.2e0.5 For the wrong expression ,e It should be followed by an integer .

'\72' Represents a legal character constant ,\ For escape characters , For octal ,ascii Code for 8*7 + 2= 58;58 This ASCII, namely ':' This character

6、

void main (void) {
    int x;
    x = printf(“I See, Sea in C”);
    printf(“x=%d” , x); 
}

When the program is finished x What is the value of ?

15

printf() The return value of is the number of characters printed , If an error occurs, a negative value is returned .

x To be an assignment 15.

 

版权声明
本文为[OceanKeeper1215]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545105346.html