c和c ++中数组的区别? [英] difference for array in c and c++?

查看:99
本文介绍了c和c ++中数组的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

c ++中的数组与数组有什么不同?

解决方案

< blockquote> user923005说:


9月24日晚上11点20分,anto frank< j.antofrank ... @ gmail.comwrote:
< blockquote class =post_quotes>
> hi friends,
c ++中的数组和c ++数组有什么不同?



当然,如果它是一个对象数组。



在C和C ++中,除了一个对象数组之外没有其他类型的数组

(在C意义上)这个词,也就是没有任何可能性,这个词很可靠。


< snip>


-

Richard Heathfield< http://www.cpax.org.uk>

电子邮件:-http:// www。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日


user923005写道:


9月24日晚上11点20分,anto frank < j.antofrank ... @ gmail.comwrote:


>朋友们,
在c ++中的数组和c ++中的数组有什么不同?



当然,如果它是一个对象数组。



只有这些是C ++类型,如果代码编译为C,则没有任何

的差异。


-

Ian Collins。


9月25日上午12:21,Ian Collins< ian-n ... @ hotmail.comwrote:


user923005写道:


9月24日晚上11点20分,anto frank< j.antofrank ... @ gmail.comwrote:


hi friends,

c ++中的数组和数组中的数组有什么不同?


当然,如果它是一个对象数组。



只有当这些是C ++类型时,如果代码编译成C,则没有任何与b

的区别。



除了分配内存管理的差异外,公共

符号名称也可以不同。 C ++数据类型可以装饰

,名称包含名称。因此,如果您链​​接到在C中编译的公共符号

,并且您的程序是C ++,则可能必须使用

externC来定义链接。


hi friends,
is ther any difference in array in c and array in c++?

解决方案

user923005 said:

On Sep 24, 11:20 pm, anto frank <j.antofrank...@gmail.comwrote:

>hi friends,
is ther any difference in array in c and array in c++?


Sure, if it''s an array of objects.

In both C and C++, there''s no other kind of array than an array of objects
(in the C sense of the word, which is also as near as makes no odds the
C++ sense of the word).

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


user923005 wrote:

On Sep 24, 11:20 pm, anto frank <j.antofrank...@gmail.comwrote:

>hi friends,
is ther any difference in array in c and array in c++?


Sure, if it''s an array of objects.

Only if those are C++ types, if the code compiles as C, there isn''t any
difference.

--
Ian Collins.


On Sep 25, 12:21 am, Ian Collins <ian-n...@hotmail.comwrote:

user923005 wrote:

On Sep 24, 11:20 pm, anto frank <j.antofrank...@gmail.comwrote:

hi friends,
is ther any difference in array in c and array in c++?

Sure, if it''s an array of objects.


Only if those are C++ types, if the code compiles as C, there isn''t any
difference.

Besides the difference for allocated memory management, the public
symbol names can also be different. C++ data types can be decorated
with name mangling stuff. So if you link to a public symbol compiled
in C and your program is C++ you may have to define the linkage with
extern "C".


这篇关于c和c ++中数组的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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