Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need c++ format c - string problems need both .h and .cpp Wrap a C-Style String Now that you have seen what we can do
need c++ format
c - string problems
need both .h and .cpp
Wrap a C-Style String Now that you have seen what we can do by creating a relatively thin object wrapper around a raw C++ array, apply that to create a safer [if not "friendlier] version of a character string. Create the header file StringWrapper.h and implementation file StringWrapper.cpp. You will be defining a class Stringwrapper using the techniques you've just applied, but with a raw character array (C-Style string) as the underlying storage unit instead of an integer array. Your library should meet the following requirements: Add code to your main program to test the functionality of StringWrapper as you go. Remember: Compile and test often! Allow the underlying maximum capacity to be 1048576 bytes (IMiB in bytes 10242 bytes]. Since 1 char is 1 byte, the maximum capacity is exactly 1048576 characters. Use a const static attribute for this as you did for the ArrayWrapper earlier There is no need to also store a "logical size" attribute like we did with the integer array. The storage will be a valid C-Style string [null-terminated]. so it we can use functions intended for C-Strings with it. The constructor should take a const-qualified C-Style string as its argument. Use the strncpy) function from theStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started