-1
我用C语言编写了一个简单的代码,使用NetCDF库来读取NetCDF文件。我编写了查看Unidata提供的NetCDF C文档的代码。'&'令牌之前的语法错误
int ncid=0;
errstatus = nc_open("test2.pval.47000", NC_NOWRITE, &ncid);
if(errstatus)
handle_error();
int ndims, ngatts, nvars, unlimdimid;
errstatus = nc_inq(ncid, &ndims. &nvars, &ngatts, &unlimdimid);
if(errstatus)
handle_error();
printf("Number of dimesnions: %d\n", ndims);
printf("Number of variables: %d\n", nvars);
printf("Number of global attributes: %d\n", ngatts);
我编译的代码通过命令
gcc -c -I/usr/local/include test.c
,但我收到以下错误
test.c: In function `main':
test.c:27: error: syntax error before '&' token
能否请你帮我出。
'&ndims.'应该是'&为ndims,' – hmjd
哪些线是线18和27? –
对不起,我应该在发布之前仔细查看代码。 – user2401047