Learning Goal: I’m working on a c++ discussion question and need support to help

Learning Goal: I’m working on a c++ discussion question and need support to help me learn. stub a function called string_length in your functions module (a ‘stub’ is a prototype plus an
empty function definition). ○ In functions.h add a prototype inside the #ifndef directive int string_length(const char*); ○ In functions.cpp add #include “functions.h” and the following code: int sting_length(const char *str){ return 0;}○ In main.cpp add the following below the last cout you added: if(argc > 1){std::cout << "The length of the first parameter is " << string_length(argv[1]) << std::endl;● Compile and run with: ○ a.out (or a on Windows) ○ a.out hello (or a hello on Windows) ● You should see something like this: see the attached file the question is: You must use a loop of some sort in string_length() and may not use any “magic” library function to tell you the string length. In other words, make a loop to count the characters in the array and return that count. ● Other than having to use a loop in string_length(), code whatever else you think you need to make your program work EXACTLY like the examples below. ● Note that your program has to work for any number of parameters from 0 to n where n is any number.Note: see the attached file for more details. Requirements: any

Published
Categorized as C#

Leave a comment

Your email address will not be published. Required fields are marked *