记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:12:29: error: expected ')' before '(' token
 m = (int )malloc(sizeof(int)(n));
                             ^
foo.cc:12:32: error: cast from 'void*' to 'int' loses precision [-fpermissive]
 m = (int )malloc(sizeof(int)(n));
                                ^
foo.cc:12:5: error: invalid conversion from 'int' to 'int*' [-fpermissive]
 m = (int )malloc(sizeof(int)(n));
     ^~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:9:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d", &n);
 ~~~~~^~~~~~~~~~
foo.cc:10:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d", &x);
 ~~~~~^~~~~~~~~~
foo.cc:15:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d", m + i);
 ~~~~~^~~~~~~~~~~~~

信息

递交者
类型
递交
题目
2-4 点名上前
语言
C++
递交时间
2021-01-28 21:37:56
评测时间
2021-01-28 21:37:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes