需要帮助将C ++转换为C语言 [英] Need help in converting C++ to C

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

问题描述

我是一个新的编程,我已经设法用C ++创建一个简单的工资单数据库,但现在我想转换成C但我不断收到错误,任何人都可以帮助我将此代码转换为C我真的需要这个,所以我可以在C中学习我的错误。下面是我开发的C ++代码。

谢谢,

展开 | 选择 | Wrap | 行号

解决方案

嗯,你会遇到一些问题,但那些问题主要是处理I / O.我建议先通过并更换所有的couts。你所有的控制结构都是一样的,所以我很确定你只需要做cin / couts和文件IO。可能还有一些我在现场检查中遗漏的其他东西,但那些应该让你达到一个水平,编译中的错误会向你展示其他任何东西。


< blockquote>嗨我试图将cout函数更改为printf它可以完美地工作,但是当我使用任何stdin函数时,就像scanf一样,我不断收到错误。我也无法更改流功能。我已经尝试了过去1周的在线教程,但我被困在scanf和流文件功能中。请帮我。谢谢



嗨我试图将cout函数更改为printf它可以完美地工作,但是当我使用任何stdin函数'时像scanf一样,我不断收到错误。我也无法更改流功能。我已经尝试了过去1周的在线教程,但我被困在scanf和流文件功能中。请帮我。谢谢



您是否更改了处理这些内容的库? C和C ++使用不同的标题......


hi i am kind of new to programming, i have managed to create a simple payroll database in C++, but now i am trying to convert in into C but i am keep getting error, can anyone help me convert this code to C. I really need this so thatr i can learn my mistakes in C. Below is the C++ code that i have have developed.
Thank you,

Expand|Select|Wrap|Line Numbers

解决方案

Well, you''re going to have a few issues, but those will mostly deal with I/O. I''d recommend going through and replacing all the couts first. All your control structures will be the same, so I''m pretty sure you''ll just need to do the cin/couts and the file IO. There might be a few other things that I''m missing on the spot-check, but those should get you down to a level where the errors in compilation will show you any of the others.


hi i tried to change the cout function to printf it can work perfectly, but when i use any stdin function''s like scanf, i keep getting errors. I am also having trouble changing the stream functions. i have tried online tutorial''s for the past 1 week but i am stuck in the scanf, and stream file functions. Please help me. Thank you


hi i tried to change the cout function to printf it can work perfectly, but when i use any stdin function''s like scanf, i keep getting errors. I am also having trouble changing the stream functions. i have tried online tutorial''s for the past 1 week but i am stuck in the scanf, and stream file functions. Please help me. Thank you

Have you changed the libraries that handle those things? C and C++ use different headers...


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

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