在Unix和Visual Studio 2010中创建了相同的程序,Visual Studio不会编译

Sam*_*nna -1 c++ unix compiler-errors

我们在Sun OS 5.9上使用Emacs.我在emacs和visual studio中编写了完全相同的代码,并将它们放在unix服务器上的自己的文件夹中.来自emacs的那个编译没有问题,但来自visual studio的那个不会.我在emacs中打开了visual studio版本,它看起来就像我在emacs中创建的那个但它不会编译.编译器是g ++这是代码:

// Samuel LaManna

#include <iostream>

using namespace std;

int main()
{
    cout<<endl;
    cout<<endl;
    cout<<"Hello World!";
    cout<<endl;
    cout<<endl;
    return 0:
}
Run Code Online (Sandbox Code Playgroud)

这些是我在尝试编译visual studio版本时遇到的错误:

Intro.cpp:在函数中int main()': Intro.cpp:14: error: expected;' 在':'之前令牌Intro.cpp:14:错误:在':'之前预期的primary-expression令牌Intro.cpp:14:错误:期望`;' 之前':'令牌v245-2%

Dra*_*kar 6

return 0:

错误就在那里.

return 0;;

  • 我能知道为什么这个答案被贬低了吗? (8认同)