NSC 485's actual processing time is May 15# Immigration - 落地生根
U*y
1 楼
写recursive的程序时, 经常会需要建某个variable或data structure,然后多次用到它
并需要它maintain value between calls. 一般有两种方法可以选择, 一种可以在
recursive的函数里declare它static; 另一种是在函数的wrapper里declare它然后pass by
reference.
一直想知道哪种方法更好,大家有没有什么见解?
并需要它maintain value between calls. 一般有两种方法可以选择, 一种可以在
recursive的函数里declare它static; 另一种是在函数的wrapper里declare它然后pass by
reference.
一直想知道哪种方法更好,大家有没有什么见解?