当前位置:网站首页>7-21日错题涉及知识点。
7-21日错题涉及知识点。
2022-04-23 05:46:00 【OceanKeeper1215】
1、权限为765的文件,对应的权限位标记为?
Linux中对文件的权限表示为rwx。
权限标记表示时第一位表示的是文件或目录,文件用-表示,目录用d表示。
从第二位开始到最后一位,每三位分为一组,表示文件所有者,同组者以及其他用户对文件 的操作权限。
本题的解答是先将765分别表示为对应的二进制数,得到111110101,对应rwxrw-r-x.再加上第一位表示文件。最终答案为:-rwxrw-r-x.
2、若有以下程序
#include <stdio.h>
#define SUB( X,Y ) (X+1)*Y
main( )
{
int a=3,b=4;
printf( "%d\n" ,SUB( a++ ,b++ ) );
}
程序运行后的输出结果是? 16
i++意思是先用i的值 之后在自加
++i意思是先自加 再去用i的值
宏定义只是做个简单的替换,执行SUB( a+ + ,b+ + ) =SUB( a+ + +1)*b+ +=16
3、
真值为-100101的数在字长为8的机器中,其补码形式为(11011011)。
原码为:10100101(字长为8的机器,数据没有八个字节,故在符号位之后补0)
4、
一个C语言程序在一台32位机器上运行。程序中定义了三个变量x、y和z,其中x和z为int型,y为short型。当x=127,y=-9时,执行赋值语句z=x+y后,x、y和z的值分别是
x=0000007FH,y=FFF7H,z=00000076H
C语言中的整型数据为补码形式,int为32位,short为16位,故x、y转换成十六进制为0000007FH、FFF7H。执行z=x+y时,由于x是int型,y为short型,需将短字长数据转换成长字长数据,称之为“符号扩展”。由于y的符号位为1,故在y的前面添加16个1,即可将y上升为int型,其十六进制形式为FFFFFFF7H。最后执行加法,即0000007FH +FFFFFFF7H=00000076H,其中最高位的进位1自然丢弃
5、以下所列的 C 语言常量中,错误的是()

U表示该常数用无符号整型方式存储,相当于unsigned int,即1U相当于unsiged int 1; L表示该常数用长整型方式存储,相当于long; F表示该常数用浮点方式存储,相当于float
1.2e0.5 为错误的表达方式,e后应该跟整数。
'\72'代表合法的一个字符常量,\为转义字符,代表八进制,ascii码为8*7 + 2= 58;58这个ASCII,即':'这个字符
6、
void main (void) {
int x;
x = printf(“I See, Sea in C”);
printf(“x=%d” , x);
}
程序完成后x的值是什么?
15
printf()的返回值是打印的字符数,如果发生错误则返回一个负值.
x被赋值为15.
版权声明
本文为[OceanKeeper1215]所创,转载请带上原文链接,感谢
https://blog.csdn.net/OceanKeeper1215/article/details/118973453
边栏推荐
- Stability building best practices
- Sakura substring thinking
- What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
- MySQL table constraints and table design
- SVN简单操作命令
- Framework analysis 2 Source code - login authentication
- Framework analysis 1 Introduction to system architecture
- 5.The Simple Problem
- DBCP usage
- MySQL occasional Caton
猜你喜欢

自动控制原理知识点整合归纳(韩敏版)

Why does the subscript of the array start from 0 instead of 1?
![[leetcode 19] delete the penultimate node of the linked list](/img/ba/3c73fba8c4b4e3de7e506670144890.png)
[leetcode 19] delete the penultimate node of the linked list

P1586 solution to tetragonal theorem

Class loading and classloader understanding

Explanation of login page

IO multiplexing of 09 redis

檢測技術與原理

检测技术与原理

The bottom implementation principle of thread - static agent mode
随机推荐
DBCP usage
[leetcode 59] spiral matrix II
Explanation of the second I interval of 2020 Niuke summer multi school training camp
scikit-learn sklearn 0.18 官方文档中文版
SVN简单操作命令
Type conversion in C #
[untitled] database - limit the number of returned rows
MySQL best practices for creating tables
How SYSTEMd uses / etc / init D script
斯坦福机器学习课程汇总
Sakura substring thinking
4. Print form
Guaba and Computational Geometry
[leetcode 202] happy number
9.Life, the Universe, and Everything
Addition, deletion, query and modification of data
Cf515b drazil and his happy friends
SQL optimization best practices
[leetcode 228] summary interval
serde - rust的序列化方案