我预见到你的方法会遇到一些问题;特别是,使用malloc()过于复杂,因为你可以分配(因此 Richard 我的解释错了吗?请e xplain。 问候, Suman。Hi,What I understand is:1.`struct mystruct'' and `mystruct_without_const'' are distinct types2.Now 6.2.5#25 says "The qualified or unqualified versions of a type..."which implies (for me) something likeconst struct mystruct something;struct mystruct somethingElse;have "The same representation and alignment requirements ..."and so do:const struct mystruct_without_const something2;struct mystruct_without_const somethingElse2;But that does not imply(for me)that the two structs have same alignmentrequirements etc.Am I wrong in my interpretation?Please explain.Regards,Suman. 这篇关于const成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 18:14