Question: rrays: Character Arrays vs . cStrings - First, guess the following output. Write down what you think the output is . - Then enter the
rrays: Character Arrays vs cStrings
First, guess the following output. Write down what you think the output is
Then enter the code and run the program to see if you are correct.
#include
#include
#include
using namespace std;
int main
double floatArray;
cout A The floatArray output using cout
t
floatArray
;
cout B Output of the floatArray values using a for loop
t;
for int i ; i ; i
cout floatArrayit;
cout endl endl;
int intArray;
cout C Output of the intArray values using cout
t
intArray
;
cout D Output of the intArray values using a for loop
t;
for int i ; i ; i
cout intArrayit;
cout endl endl;
char cStringArray;
strcpycStringArray "Tom Lee";
cout E Output of strcpy assignment to cStringArray using cout
t;
for int i ; i ; i
cout cStringArrayi;
cout endl endl;
Page of
cout F Enter a character name to be read by cin.getline: ;
cin.getlinecStringArray;
cout
tOutput after entering letters output by cout :
t;
cout cStringArray endl;
char yourName;
strcpyyourName "Tom Lee";
cout G What is output when using:
t
strcpyyourNameTom Lee; and cout yourName:
t;
cout yourName endl;
char myName "Tom Lee";
cout H What is output when using:
t
"char myName Bob Lee; and cout myName:
t;
cout myName endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
