一些简单的问题 [英] Some simple questions

查看:77
本文介绍了一些简单的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。 1U表示1是无符号整数而不是另一个无符号类型?


2.''\ 012''和''\ xb''值与012相同0xb?


3.任何数字如下所示:


''\ 546''


被视为八进制或小数?

1. 1U means that 1 is an unsigned int and not another unsigned type?

2. ''\012'' and ''\xb'' values are the same with 012 and 0xb?

3. Any numbers appearing like the following:

''\546''

are considered octals or decimals?

推荐答案

Ioannis Vranos写道:
Ioannis Vranos wrote:

1. 1U表示1是无符号整数而不是另一个无符号类型?
1. 1U means that 1 is an unsigned int and not another unsigned type?



Unsigned int。

Unsigned int.


2.''\ 012''和''\ xb ''值与012和0xb相同?
2. ''\012'' and ''\xb'' values are the same with 012 and 0xb?



编号前者属于char类型,后者属于int类型。

No. The former are of type char, while the latter are of type int.


3任何数字如下所示:


''\ 546''


被视为八进制或小数?
3. Any numbers appearing like the following:

''\546''

are considered octals or decimals?



我不记得了。试试google。

I don''t remember. Try google.


Juha Nieminen写道:
Juha Nieminen wrote:

Ioannis Vranos写道:
Ioannis Vranos wrote:

> 1。 1U表示1是无符号整数而不是另一个无符号类型?
>1. 1U means that 1 is an unsigned int and not another unsigned type?



Unsigned int。


Unsigned int.



是否有任何unsigned short的说明符?

Is there any specifier of unsigned short?


>
>

> 2。 ''\ 012''和''\ xb''值与012和0xb相同?
>2. ''\012'' and ''\xb'' values are the same with 012 and 0xb?



编号前者属于char类型,后者属于int类型。


No. The former are of type char, while the latter are of type int.



好​​的,除了类型,它们是相同的值吗?


OK, apart from the type, are these the same values?


> ;
>

> 3。任何数字如下所示:

''\ 546''

被视为八进制或小数?
>3. Any numbers appearing like the following:

''\546''

are considered octals or decimals?



我不记得了。试试谷歌。


I don''t remember. Try google.



如果有人有特定答案,那就更好了。至于尝试,我想这个案例比bogle更好。 :-)

If anyone has a specific answer it will be better. As for trying, a
compiler is better than google for this case I guess. :-)


Ioannis Vranos写道:
Ioannis Vranos wrote:

Juha Nieminen写道:
Juha Nieminen wrote:

> Ioannis Vranos写道:
>Ioannis Vranos wrote:

>> 1。 1U表示1是无符号整数而不是另一个无符号类型?
>>1. 1U means that 1 is an unsigned int and not another unsigned type?


Unsigned int。


Unsigned int.



是否有任何unsigned short的说明符?


Is there any specifier of unsigned short?


>>
>>

>> 2。 ''\ 012''和''\ xb''值与012和0xb相同?
>>2. ''\012'' and ''\xb'' values are the same with 012 and 0xb?


否。前者属于char类型,后者属于int类型。


No. The former are of type char, while the latter are of type int.




好​​的,除了类型,这些值是否相同?



OK, apart from the type, are these the same values?


>>
>>

>> 3。任何数字如下所示:

''\ 546''

被视为八进制或小数?
>>3. Any numbers appearing like the following:

''\546''

are considered octals or decimals?


我不记得了。试试谷歌。


I don''t remember. Try google.



如果有人有特定答案,那就更好了。至于尝试,我想这个案例比bogle更好。 :-)


If anyone has a specific answer it will be better. As for trying, a
compiler is better than google for this case I guess. :-)



代码:


#include< iostream>

int main ()

{

使用命名空间std;


int x =''\ 146''';

cout<< X LT&;< " \\\
"<<辛<< X LT&;< " \\\
"<<十六进制<< X LT&;<结束;

}

在我的系统中产生:

[john @ localhost src]


The code:

#include <iostream>
int main()
{
using namespace std;

int x= ''\146'';
cout<< x<< "\n"<< oct<< x<< "\n"<< hex<< x<< endl;
}
produces in my system:
[john@localhost src]


这篇关于一些简单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆