Warning: Undefined array key "domain" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 50

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52

Warning: Undefined array key "domain" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 50

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52

Warning: Undefined array key "domain" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 50

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 51

Warning: Undefined array key "info" in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52

Warning: Trying to access array offset on value of type null in /www/wwwroot/doupi.com/src/api/controller/link.php on line 52
非计算机专业,好奇为什么会出现“程序依赖bug运行”的情况?_河北省保定市徐水区志摊化学锚栓有限责任公司
400-001-6558
热销产品:
当前地址:当前位置: 首页 >

非计算机专业,好奇为什么会出现“程序依赖bug运行”的情况?

更新时间:2025-06-24 07:10:10 浏览次数:

举个例子。

比如在c/c++语言里,这个写法是非法的,bug: int* fun(int nums[], size_t len) { int sth; char c1; float other; char c2; int tmpNum[len]; char str[len]; //do sth return tmpNum; }其中的tmpNum叫局部变量,它分配在栈上;当fun执行了return时,这块内存就被自动收回了,就不能再读写了。

但如果你不懂,你就是把tmpNum返回了;那么下游的使用者还真就能读到里面的值——内存是被收回了,但数据仍然在内存条上…。

非计算机专业,好奇为什么会出现“程序依赖bug运行”的情况?
成功案例
学校用户 企业用户
语音室产品分类