I tried to initialize this array but it shows the error as- expression must be a modifiable lvalue.
struct sur { int n[10]; }s; s.n={1,2,3};
I tried to initialize this array
But that's not what your code actually does. Your code tries to assign to an array. And no, that's not supported by either C or C++.