【发布时间】:2011-03-25 15:15:16
【问题描述】:
我刚从 Vala 开始,我尝试制作一个简单的程序来询问两个输入:
- 一个指定循环度的int;和
- 一个包含 I/R 的字符,用于迭代或递归过程。
就在编译之前,我收到了这个错误:
test0.vala:8.5-8.16: error: Access to instance member `test0.test_exec' denied
test_exec(q);
^^^^^^^^^^^ //the entire statement
Compilation failed: 1 error(s), 0 warning(s)
这个非常简单的程序的pastebin位于here。
这是一个sn-p:
public static void main(string[] args)
{
stdout.printf("Greetings! How many cycles would you like? INPUT: ");
int q=0;
stdin.scanf("%d", out q);
test_exec(q);
}
public void test_exec(int q)
{
//method code here
}
您能告诉我该怎么做,以及一些提示吗?谢谢。
【问题讨论】:
-
@Rek:欢迎来到代码审查。该站点用于查看工作代码,而不是用于修复损坏的代码。请参考常见问题解答:codereview.stackexchange.com/faq
标签: vala