Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use C++ to Code!! ttu.blackboard.com nttps:i/ttu.blackboard.c pid-3044792-dt-con

ID: 3607614 • Letter: U

Question

Use C++ to Code!!

ttu.blackboard.com nttps:i/ttu.blackboard.c pid-3044792-dt-content-rid-16559539 1/courses/201827-ECE-1305-002 ECE-1305 Hw... l Guided Solutions and y Help i C Introduction to Electrical and Computer Engineering ECE-1305 9) Which of the following properly defines) the C-string containing "Hello"? Explain why the incorrect option(s) do not work properly a) char stringvar[10] = "Hello". b) char stringvar[10] = {' ', 'e', 'I', 'l', 'o'); c) char stringvar[10] = {'H', 'e', 'I', 'l','o', ''); d) char stringvar[7] = "Hello"; e) char stringvar[] = "Hello". f) char str. ngvar[5] = "Hello", 10) In the following code fragment: char s[20], i[25], t [30]; cout>i; cin>>t; cout

Explanation / Answer

9.

a)

char stringVar[10] = "Hello";

Explanation:

It is true because it stores  Hello that is 5 letters and NULL string it requires min size 6bits but it allocates 10 bits

b)

Explanation:

char stringVar[10] = {'H','e','l','l','o'};

It is true because it stores  Hello that is 5 letters and NULL string it requires min size 6bits but it allocates 10 bits.

c)

Explanation:

char stringVar[10] = {'H','e','l','l','o',};

It is true because it stores Hello that is 5 letters and NULL string it requires min size 6bits but it allocates 10 bits.

d)

char stringVar[7] = "Hello";

Explanation:

It is true because it stores  Hello that is 5 letters and NULL string it requires min size 6bits but it allocates 7 bits

e)

char stringVar[] = "Hello";

Explanation:

It is True because it allocates memory automatically

f)

char stringVar[5] = "Hello";

Explanation:

It is not true because it stores  Hello that is 5 letters and NULL string so min size is 6 bis it allocates 5 bits only.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote