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);
~~~~~^~~~~~~~~~~~~