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};
Without more context, we can't know precisely how you are trying to initialize. Initializing at the point of definition could be:
struct sur { int n[10]; } s = {{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++.
Thank You. That worked