Initializing an array

char s[3];
s=“Lk”; //error
s[]=“Lk”; //error

why i am unable to this?

@n.nishchaya2000 you can only assign such way while declaring s!
after that you need to update s similarly you update an array(since s is also char array)
eg:
char s[3]=“ek”; //fine
else
char s[3];
s[0]=‘e’;
s[1]=‘k’;
s[2]=’\0’;
is also good

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.