我试图允许一个函数使用evalin函数访问基本工作区,但我遇到了问题。下面是一个简单的例子:
我的主要代码:
A = 1;
B = 2
evalin('base','[ C ] = FUN(B)');
C
我的职能:
function [C ] = FUN( B )
C = A + B;
end
我的错误:
Undefined function or variable 'A'.
Error in FUN (line 4)
C = A + B;
Error in Test (line 4)
evalin('base
我刚刚完成了K&R (第二版)前1-18岁我对C相当陌生,但在其他语言(Perl、C++、Java、Common、PHP等)方面有经验,并且非常想学习C成语,而不是翻译我已经知道的成语。
你觉得这种1-18的方法怎么样?
/*
Exercise 1-18 in K&R 2nd Edition
Removes trailing blanks & tabs & blank lines from each line of input
Written by Z. Bornheimer (provided as is without warranty).