gpt4 book ai didi

c - 注意 : C++ does not support default-int

转载 作者:行者123 更新时间:2023-12-01 09:07:32 25 4
gpt4 key购买 nike

我在 Visual Studio 中收到此消息:

Note: C++ does not support 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");
}
}

最佳答案

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

const int variable1; //OK
const variable2; //Not OK

这是错误的 MSDN 描述:

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

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

关于c - 注意 : C++ does not support default-int,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1962449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com