C和C ++中的结构 [英] Struct in C and C++
本文介绍了C和C ++中的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C和C ++中的struct是一样的吗? C中的Struct可以处理成员函数吗?
Struct in C and C++ are same? Can Struct in C handle member functions?
推荐答案
>>>> C和C ++中的struct是一样的吗? C中的Struct可以处理成员函数吗?
否
>>>> Struct in C and C++ are same? Can Struct in C handle member functions?
No
VI ******************** @ gmail.com 写道:
C和C ++中的结构是一样的吗?
Struct in C and C++ are same?
NO
可以在C中结构化处理会员功能?
NO
NO
Can Struct in C handle member functions?
NO
Jaspreet写道:
Jaspreet wrote:
vi ********** **********@gmail.com 写道:
C和C ++中的结构是一样的吗?
Struct in C and C++ are same?
NO
<可以在C处理成员函数吗?
没有
NO
Can Struct in C handle member functions?
NO
struct X
{
无效(* f)();
};
....
>
void ConstructX(struct X * x)
{
x =& someFun;
}
只需要更多的手工工作。
struct X
{
void (*f)();
};
....
void ConstructX(struct X * x)
{
x = &someFun;
}
It''s just a lot more hand work.
这篇关于C和C ++中的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文