Suppose that structures and variable p are declared as follows: struct new_struct{ char a; int b[10]; }; struct new_struct s; Which one of the following statements will update the 3rd element of b in the structure s to 34? s.b= 34; s.b[2] =34;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question
Suppose that structures and variable p are declared as follows:
struct new_struct{
char a;
int b[10];
};
struct new_struct s;
Which one of the following statements will update the 3rd element of b in the structure s to 34?
s.b= 34;
s.b[2] =34;
Transcribed Image Text:Suppose that structures and variable p are declared as follows: struct new_struct{ char a; int b[10]; }; struct new_struct s; Which one of the following statements will update the 3rd element of b in the structure s to 34? s.b= 34; s.b[2] =34;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr