填充颜​​色填充实现控制堆栈 [英] floodfill color filling implementation controlling stack

查看:76
本文介绍了填充颜​​色填充实现控制堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在用C进行简单的油漆刷.
我需要实现泛洪填充以填充颜色,但是存在堆栈克服的问题.什么是控制堆栈和应用程序运行而不会崩溃的解决方案.

Hi,
I am working on simple paint brush in C.
I need to implement floodfill to fill color but there is problem of stack overcoming.What is solution to control stack and application running without crash.

推荐答案

我认为您需要了解动态内存管理的乐趣.

这是文档的链接:
内存分配 [
I think you need to learn about the joys of dynamic memory management.

Here is a link to the documentation:
Memory Allocation[^]

Remember that you should free everything that you have allocated - loosing track of memory allocations can be a major headache - good luck, many find this one of the trickier things to get right :)

Regards
Espen Harlinn


您只需要查看/调试代码.你知道什么堆栈吗?首先要学习的东西之一...
堆栈溢出表明您没有停止递归(包括相互递归).检查它.如果这个问题是99.99%,那么我会说是递归.

—SA
You just need to review/debug the code. Do you know what stack does? One of the first things to learn…
Stack overflow is a sign that you don''t stop your recursion (including mutual recursion). Check it up. Recursion is the source if this problem, 99.99%, I would say.

—SA


这篇关于填充颜​​色填充实现控制堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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