注意:C++不支持default-int

ham*_*mza 2 c visual-studio-2008

我在Visual Studio中收到此消息:

注意:C++不支持default-int

我的C代码出了什么问题?

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void remplire (int t[], int n);
void afficher (int t[], int n);

void main ()
{
    const long_tab = 2000;
    int t[long_tab];
    srand (time(NULL));
    remplire (t, long_tab);
    afficher (t, long_tab);
}

void remplire (int t[], int n)
{
    int i;
    for (i = 0; i <= n; i++)
    {
        t[i] = rand (); 
    }
}

void afficher (int t[], int n)
{
    int i;
    for (i = 0; i <= n; i++)
    {
        printf ("%d \t", t[i]);
        if (i % 10 == 0)
            printf ("\n");
    }
}
Run Code Online (Sandbox Code Playgroud)

Igo*_*aka 12

省略标识符类型时,C++会显示此错误.

const int variable1; //OK
const variable2; //Not OK
Run Code Online (Sandbox Code Playgroud)

这是MSDN描述的错误:

http://msdn.microsoft.com/en-us/library/ms173696%28VS.80%29.aspx

此外,如果您在输出选项卡中突出显示错误并按F1 - Visual Studio帮助将显示一个更详细地解释错误的页面,类似于上面的链接.