Answered Questions

  • Why is assigning to string as given below not allowed?

    Consider the code:main() { char s[8] = “Exforsys”; } The above code is not allowed in string handling concept. This is because strings are represented in C programming language as arrays and therefore assigning as above arrays is not allowed.One can make use of strcpy() which is a string handling function present in string.h header file for this purpose. So the above code can be written as#include...

    Abhi Phirke

    • Nov 19th, 2007

    main(){char a[10]={'e','x','f','o','r','y','s', ''};}Aint this more correct? We are talking about strings here...!