将嵌入式C ++代码转换为C语言 [英] Convert embedded C++ code into C

查看:82
本文介绍了将嵌入式C ++代码转换为C语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在C ++中有这个工作代码,但我正在开发一个基本相同的电路但处理器不同的新原型,我需要它C中的程序。



我在处理器的C中有一个API参考和示例,但转换程序绝对不包含在其中。任何人都可以建议我如何代表C中的所有公共和私人课程。



我尝试过:



我不是C和C ++的专业人士。我能够传达基本协议,这些协议只是代码的一小部分。

解决方案

C中不存在类,所以所有的类方法必须是投入内联函数。需要在任何需要的地方声明类变量。除非你对两种语言都相当熟练,否则这可能是一项艰巨的任务。您也可以尝试将c转换为c - Google搜索 [ ^ ]因为可能是一些可用的工具。


Quote:

我不是C和C ++的专家。我能够传达基本协议,这只是代码的一小部分

然后改变处理器。说真的。



除非它是一个非常简单的代码,你必须精通两个 C ++和C才能完成任务。


Hello all,

I have this working code in C++,but I am working on a new prototype with basically same circuit but different processor, for which I need the program in C.

I do have a API references and examples in C for the processor , but converting a program is definitely not included in it. Can any one suggest how do I represent all the public and private classes in C.

What I have tried:

I am not a pro at either C nor C++ . I was able to convet the basic protocols which are just a very small part of the code.

解决方案

Classes do not exist in C, so all the class methods must be put into inline functions. Class variables need to be declared wherever they are needed. Unless you are reasonably proficient at both languages this could be a difficult task. You could also try convert c to c - Google Search[^] as there may be some usable tools around.


Quote:

I am not a pro at either C nor C++ . I was able to convet the basic protocols which are just a very small part of the code

Then change processor. Seriously.

Unless it is a very trivial code, you have to be proficient in both C++ and C in order to accomplish the task.


这篇关于将嵌入式C ++代码转换为C语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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