Runtime Error in C

Run time error in C

标签:C语言 RuntimeError


目录


1.Run time error 的含义

-Run time error 便是指程序运行过程中崩溃了
-导致崩溃的原因有很多:
1)除数为0;
2)数组越界;
3)指针越界;
4)使用已经释放的空间;
5)数组定义过大,占用内存过大;
6)循环没有终止导致内存耗尽;
本博文主要讲第(6)点:循环没有终止导致内存耗尽

2.举例子

Description:
Write a program that reads an integer with 3 digits and adds all the digits in the integer.For example,if an integer is 932,the sum of all its digits is 9+3+2=14.
现在要假设处理的数字非常大( 2^64 < length <= 10^200 )
(length 指的是数字的大小!不是长度!)
input
123456789011121314151617181920
output
101

-没有一个数据类型能容下这么大的一个数字,因

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值