Homework: C-style Strings

  < Previous  Next >

Write your answers to the following questions in a flat text file hwkC-styleStrings.txt (not a Word document nor a Rich Text Format file):
  1. Declare a C-style string name oldSchoolString and initialize it to "low overhead".
  2. How many bytes does oldSchoolString require?
  3. What is the result of the following code:
    #include <iostream>
    #include <cstring>
    
    int main(){
        // Declare a C-style string name oldSchoolString and initalize it to "low overhead".
    
        std::cout << "There are " << strlen( oldSchoolString) << " characters in \"" << oldSchoolString << "\"\n";
    
        return 0;
    }
    
  4. What function in the cstring header file do you envision using the most?

Submission

Submit your txt file at https://3110.cs.mtsu.edu/. For further instructions, please see the Miscellaneous page.

Rubric:

Points          Item
----------      --------------------------------------------------------------
_____ /  1      1
_____ /  1      2
_____ /  1      3
_____ /  1      4
        
_____ /  4      Total
      

Last Modified: