使用结构的长号Claculator [英] Claculator for long numbers using structures

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

问题描述

问题解决了,谢谢。我不知道如何删除这篇文章...



我尝试过:



感谢您的帮助,我不知道如何删除这篇文章。

Problem solved, thank you. I don´t know how to delete this post so...

What I have tried:

Thank you for helping, I do not know how to delete this post.

推荐答案

您的 scanf 声明是错误的。数组名称已经是指针,因此不需要地址(&)运算符:

Your scanf statement is wrong. Array names are already pointers so do not need the addressof (&) operator:
// wrong
while (scanf("%s %s", &op, &buf) == 2)
// should be just:
while (scanf("%s %s", op, buf) == 2)



您还需要刷新输入下一个 scanf ,因为仍然会有一个要读取的换行符。


You also need to flush the input for the next scanf, as there will still be a newline character to be read.


这篇关于使用结构的长号Claculator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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