previous | start | next

C Strings: Declarations

        char s1[] = {'C', 'a', 't', '\0'};
        char s2[] = "Cat";
        char s3[4] = "Cat";


        cout << s1 << endl;
        cout << s2 << endl;
        cout << s3 << endl;

     

All 3 print the same output:

        Cat
     


previous | start | next