将输出什么,如果我写为什么语法错误
在C++ if(5)
将没有任何问题,但不是在C#同样的方式将它能够运行执行。
if(func()){} //in C# it doesn't runs Why how does C# treats void and how in Turbo C++
void func()
{
return;
}
if(null==null){}//runs in C#
编辑
if(printf("Hi"){} //will run and enter into if statement
if(printf(""){}//will enter into else condition if found.
这个问题并不意味着对那些谁不知道的Turbo编译器的
'null'不是'void'。 – Amadan 2010-07-15 11:35:22
你是说'如果(无效)'在Turbo C++中工作? – 2010-07-15 11:36:02
这也是C++中的错误。问题不在于__runs__,而在于__compiles__。 C++和C#都是_compiled_语言,而不是_interpreted_。所以这个问题根本就没有意义。 '-1'。 – sbi 2010-07-15 11:47:28