从C ++到C的端口代码? [英] Port code from C++ to C?

查看:57
本文介绍了从C ++到C的端口代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我必须使用一些仅支持C的机器。但我有一些C ++

程序,它们使用大多数C ++ comman功能。有没有办法将这些C ++程序转换成C?


或者有什么方法可以模仿C ++的C ++吗?所以,即使我有重新编码的
,我也不必更改C ++代码结构。


谢谢!


祝福,



Hi,

I have to use some machine with only support of C. But I have some C++
programs, which use most C++ comman features. Is there any way to
convert those C++ programs to C?

Or is there any way that I can mimic C++ by C? So that even if I have
to recode, I don''t have to change the C++ code structures.

Thanks!

Best wishes,
Peng

推荐答案

文章< 11 ** ********************@g49g2000cwa.googlegroups .com> ;,
Pe ******* @ gmail.com < Pe ******* @ gmail.com>写道:
In article <11**********************@g49g2000cwa.googlegroups .com>,
Pe*******@gmail.com <Pe*******@gmail.com> wrote:
我必须使用一些仅支持C的机器。但我有一些C ++程序,它们使用大多数C ++ comman功能。有没有办法将这些C ++程序转换为C?
I have to use some machine with only support of C. But I have some C++
programs, which use most C++ comman features. Is there any way to
convert those C++ programs to C?




请参阅从
开始的主题 http://groups.google.ca/group/comp.l...592bd669995492

Who Leads? /男人必须......驱使男人,强迫男人。

怪胎男人。

你们都是怪胎,先生。但你一直都是怪胎。

生活是一个怪胎。这是它的希望和荣耀。 - Alfred Bester,TSMD



Please see the thread starting from
http://groups.google.ca/group/comp.l...592bd669995492
--
"Who Leads?" / "The men who must... driven men, compelled men."
"Freak men."
"You''re all freaks, sir. But you always have been freaks.
Life is a freak. That''s its hope and glory." -- Alfred Bester, TSMD


感谢您的回复!但是这个帖子并没有解决我想要的所有问题。


我不仅希望将C ++端口转换为C(不一定是预处理器),我还需要
希望C代码是人类可读的。


所以现在的问题是如何用C语言实现OO。

我读过一些旧的OO讨论这个问题的书,因为当时没有足够的OO支持

。但是我忘记了这本书的标题。


如果你能给我任何相关信息,那就太棒了。




Thank you for your reply! But this thread doesn''t address all I want.

Not only I want port C++ to C (not necessarily by a preprocessor), I
also want the C code human readable.

So the problem right now is that how to implement OO in C language.
I''ve read some old OO book which discuss this issue, because there were
no enough OO support at that time. But I forget the title of the book.

If you can give me any relevant information, it will be great.

Peng


在文章< 11 ********************** @ g14g2000cwa.googlegroups .com> ;,
Pe*******@gmail.com < Pe **** ***@gmail.com>写道:
In article <11**********************@g14g2000cwa.googlegroups .com>,
Pe*******@gmail.com <Pe*******@gmail.com> wrote:
感谢您的回复!但是这个帖子并没有解决我想要的所有问题。
我不仅希望将C ++端口转换为C(不一定是预处理器),我还希望C代码具有人类可读性。


你表示你想在C中模仿C ++。结果是

不太可能是人类可读的。


所以现在的问题是如何用C语言实现OO。
Thank you for your reply! But this thread doesn''t address all I want. Not only I want port C++ to C (not necessarily by a preprocessor), I
also want the C code human readable.
You indicated that you wanted to mimic C++ in C. The result is
not very likely to be human readable.

So the problem right now is that how to implement OO in C language.




不要。如果您需要C ++,那么使用C ++。如果你不需要C ++那么

用C范式编写,而不是用C ++范例编写。任何写一个

混合动力的尝试都可能以丑陋的代码结束。

-

那时候我很年轻,但是我也很朦胧。

- 克里斯托弗牧师



Don''t. If you need C++ then use C++. If you don''t need C++ then
write in C paradigms, not in C++ paradigms. Any attempt to write a
hybrid is likely to end up with ugly code.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest


这篇关于从C ++到C的端口代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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