语言学等 [英] Linguistics and such

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

问题描述



我正在撰写一份报告,并且有几个问题我想要

澄清:


是'c'还是''C''?

在C ++中,类的实例是''对象''。是一个结构的实例

也是c / C中的''对象'?


标准c中是否有''const''关键字/C?你可以用它在C ++中声明数组

大小吗?


问候

Mike

解决方案

Michael写道:


我正在撰写一份报告,有几个问题我想澄清:

是'c'还是''C''?
它是''C'',因为它指的是某物的名称,

在这种情况下是一种语言。


In C ++类的实例是''对象''。结构的实例是否也是c / C中的对象?
术语对象很模糊。我的理解是

一个对象是将它与模板区分开的实例。


在C中,结构是模板,对象是从

模板。你可以有一个没有任何变量的结构

从结构创建(或作为类型)。


是否有''const''关键字标准c / C?
是的。

你能用C ++来声明数组大小吗?
const限定符与两种语言中数组的大小

无关。在这两种语言中,

数组的长度是固定的(数量),编号为

编译时间。


两种语言都允许对于内容为
常量的数组和内容为可静态的数组。

" const"限定符,当应用于数组时,指定

内容为常量。


Mike



根据Usenet的属性,我的评论将由那些了解我的人详细说明。这样的

就是Usenet的美丽。


-

Thomas Matthew


C ++新闻组欢迎辞:
http://www.slack .net / ~shiva / welcome.txt

C ++常见问题: http://www.parashift.com/c++-faq-lite

C常见问题: http://www.eskimo.com/~scs/c-faq/top.html

alt.comp.lang.learn.c-c ++ faq:
http://www.comeaucomputing.com/learn/faq/

其他网站:
http://www.josuttis.com - C ++ STL图书馆书籍
http://www.sgi.com/tech/stl - Standa模板库


Michael写道:

我正在撰写一份报告
并有一对夫妇我要澄清的问题:

是'c'还是''C''?


''C''

在C ++中,类的实例是''对象''。
是一个实例结构也是C中的对象?


是的C ++以及C

* any *类型的实例是一个对象。

有没有'标准C中的'const''关键字?
你可以用它在C ++中声明数组大小吗?




是的。

你也可以在C中声​​明变量数组大小。

这个特性很快就会被C ++采用。


在文章中< ; d1 ********** @ titan.btinternet.com>,

Michael< sl *********** @ hotmail.com>写道:

我正在撰写一份报告,并且有一些问题我想澄清:
是'c'还是''C' ?


或不是C89标准中的运算符,但c和C都是

有效字符常量。


在C ++中类的实例是''对象''。结构的实例是否也是c / C中的对象?


C没有实例这样的东西,也没有对象这样的东西。

C中的内存描述于术语对象,但是C对象

与C ++对象有根本区别。


是否存在''const ''标准c / C中的关键字?


是的。

你可以用它在C ++中声明数组
大小吗?




是的。例如,这在C和C ++中都有效。


int main(void){

char c [5 * sizeof(const int)];

返回0;

}

-

Ceci,ce n''est pasuneidée。


Hi,
I''m currently writing up a report and had a couple of question I want to
clarify:

Is it ''c'' or ''C''?

In C++ an instance of a class is an ''Object''. Is an instance of a struct
also an ''Object'' in c/C?

Is there a ''const'' keyword in Standard c/C? Can you use it to declare array
sizes as I can in C++?

Regards
Mike

解决方案

Michael wrote:

Hi,
I''m currently writing up a report and had a couple of question I want to
clarify:

Is it ''c'' or ''C''? It is ''C'', captialized, since it refers to the name of something,
in this case a language.

In C++ an instance of a class is an ''Object''. Is an instance of a struct
also an ''Object'' in c/C? The term "object" is pretty vague. My understanding is that
an object is the instance to differentiate it from a stencil.

In C, the struct is the stencil, the object is created from
the stencil. You can have a struct without have any variables
created from the struct (or as the type).

Is there a ''const'' keyword in Standard c/C? Yes.
Can you use it to declare array sizes as I can in C++? The "const" qualifier has nothing to do with the size
of an array, in both languages. In both languages, an
array is of fixed length (quantity), designated at
compile time.

Both languages allow for arrays whose contents are
constant and arrays whose contents are muteable. The
"const" qualifier, when applied to arrays, designates
the contents as constant.

Regards
Mike



Per the properties of Usenet, my comments will
be detailed by those who know more than me. Such
is the beauty of Usenet.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library


Michael wrote:

I''m currently writing up a report
and had a couple of questions [that] I want to clarify:

Is it ''c'' or ''C''?
''C''
In C++, an instance of a class is an ''object''.
Is an instance of a struct also an ''object'' in C?
Yes in C++ as well as C
an instance of *any* type is an object.
Is there a ''const'' keyword in standard C?
Can you use it to declare array sizes as I can in C++?



Yes.
You can also declare variable array sizes in C.
This feature will almost certainly be adopted by C++ soon.


In article <d1**********@titan.btinternet.com>,
Michael <sl***********@hotmail.com> wrote:

I''m currently writing up a report and had a couple of question I want to
clarify: Is it ''c'' or ''C''?
"or" is not an operator in the C89 standard, but both ''c'' and ''C'' are
valid character constants.

In C++ an instance of a class is an ''Object''. Is an instance of a struct
also an ''Object'' in c/C?
C has no such thing as an "instance", and no such thing as an ''Object''.
Memory in C is described in terms of of "object"s, but a C "object"
has fundamental differences from a C++ object.

Is there a ''const'' keyword in Standard c/C?
Yes.
Can you use it to declare array
sizes as I can in C++?



Yes. For example this is valid in both C and C++.

int main(void) {
char c[5 * sizeof(const int)];
return 0;
}
--
Ceci, ce n''est pas une idée.


这篇关于语言学等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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