编译问题 [英] Compiling problems

查看:61
本文介绍了编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在尝试编译程序时收到大量错误消息。该程序是创建一个反转数字的功能。我有一种感觉我很接近,但我无法弄清楚问题。关于istreams和ostreams,我遇到了很多错误。我一直试图弄清楚这几个小时。

Hello, i am getting numerous error messages when trying to compile my program. The program is to create a function to reverse digits. I have a feeling i am close but i can''t figure out the problem. I''m getting a lot of errors regarding istreams and ostreams. I have been trying to figure this out for hours.

展开 | 选择 | Wrap | 行号

推荐答案

大理由#1是你的<< s和>>与错误的语句结合在一起。你使用cout>>当你应该使用cout<<,并使用cin<<当你应该使用cin>>。切换这些应该可以消除很多错误。
Big reason #1 is that your <<s and >>s are coupled with the wrong statements. You use cout >> when you should use cout <<, and you use cin << when you should use cin >>. Switching these should remove a lot of the errors.


哇,我觉得现在是个完全白痴哈哈。好消息是它确实编译但坏消息是每次我试图反转负数我得到0。
Wow, i feel like a complete idiot now haha. The good news is it did compile but the bad news is that every time i try to reverse a negative number i get 0.



哇,我觉得现在是一个完全白痴哈哈。好消息是它确实编译但坏消息是每次我试图反转负数我得到0.
Wow, i feel like a complete idiot now haha. The good news is it did compile but the bad news is that every time i try to reverse a negative number i get 0.



我知道为了得到输出为负和反向我会做相同的编码只乘以rnum和结束-1,使反转的整数为负,但我不知道如何做到这一点。

I know that in order to get the output to be negative and reverse i would do the same coding only multiply rnum and the end by -1 to make the reversed integer negative but i cant figure out how to do that.


这篇关于编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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