Because it's an array not a C++ string. http://www.lysator.liu.se/c/c-faq/c-2.htmlIt works. Thanks for your help.
But I'm still wondering why we can't assign strings like that in the function?
It works. Thanks for your help.
But I'm still wondering why we can't assign strings like that in the function?
The basic problem is that when you created this global variable st, you created as an array of structures that is located at a specific place in memory that was allocated for it.It works. Thanks for your help.
But I'm still wondering why we can't assign strings like that in the function?