// strings_01.cpp -- initializing char arrays
#include <iostream>
#include <cstring>  // for the strlen() function

int main()
{
    using namespace std;

    // greeting1, no NULL char specified. keeps on reading until 
    // it sees one. get garbage chars.
    char greeting1[5] = {'h','e','l','l','o'};
    // null char specified - this is OK
    char farewell1[4] ={'b','y','e','\0'};

    // using double quotes to initialize an array:
    // declaring an array w/quotes thats bigger than your 
    // string. will fill the rest with null chars.
    char greeting2[16] = "Hello, there!";
    // no array size specified in declaration. the program
    // automatically declares the correct size. 
    char farewell2[] = "See you later.";

    // print out results
    cout << "greeting1: " << greeting1 << "\n";
    cout << "farewell1: " << farewell1 << "\n";
    
    cout << "\n";

    cout << "greeting2: " << greeting2 << "\n";
    cout << "farewell2: " << farewell2 << "\n";
}

