1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Phantasy [73]
3 years ago
13

Given the code segment below, complete the assignments as stated in the comments. struct aaa { int m; int nn; } struct bbb{ stru

ct aaa myfield; int sum; } struct bbb myvar; // write one statement to place the integer value 44 into the field sum of structure variable myvar . // write one statement to place the integer value -17 into the field nn of structure variable myvar .
Computers and Technology
1 answer:
grin007 [14]3 years ago
6 0

Answer:

  1. using namespace std;
  2. struct aaa {
  3.    int m;
  4.    int nn;
  5. };
  6. struct bbb{
  7.    struct aaa myfield;
  8.    int sum;  
  9. };
  10. struct bbb myvar;
  11. int main()
  12. {
  13.    myvar.sum =44;
  14.    myvar.myfield.nn = -17;
  15.    
  16.    cout<<myvar.sum<<"\n";
  17.    cout<<myvar.myfield.nn<<"\n";
  18.    return 0;
  19. }

Explanation:

Given two data structures (Line 2-9), we can set the value of 44 to field of sum structure variable myvar by using a dot syntax

                      myvar.sum = 44

To assign value to field of nn of structure in myvar, we need to access the myfield of myvar and then followed by nn. Hence, the statement shall be

                     myvar.myfield.nn = -17

In short the we can always use the dot syntax the access the value of an inner field of a particular data structure.

You might be interested in
Who is the three president of somalia​
Snezhnost [94]

Answer:

Siad Barre

Explanation:

3 0
3 years ago
Read 2 more answers
When did the silent movie era end?<br> A.1919<br> B.1929<br> C.1939<br> D.1949
11111nata11111 [884]

Answer:

The answer is 1929.

5 0
3 years ago
Read 2 more answers
WILL GIVE BRAINLIEST AND HALLOWEEN CANDY!!!!!!!!!<br> who wants to talk?
Tamiku [17]
<h2>Sure, I wanna talk. (:      .........................</h2>
3 0
3 years ago
Write an expression that continues to bid until the user enters 'n'.
Sergio [31]

I've seen this problem before, you just need the solution to the 'while' loop, right?


Assuming your variable names are the same as the generic question your while loop should look like this:


while (keepGoing != 'n')

7 0
3 years ago
How has the manufacturing process of cell phones evolved over time? What factors have influenced these changes? *
kicyunya [14]

Answer:

Cellphones have evolved rapidly since handheld mobile phones first appeared in the 1970s. ... Generally, phones have evolved to be more compact, to have longer battery life and to allow addition of features beyond making calls, like running apps and sending text messages.

Explanation:

7 0
3 years ago
Other questions:
  • The HR department of a company wants to send out an email informing its employees about an upcoming social event. Which email ap
    11·2 answers
  • Three IT Companies. Help me please!
    5·2 answers
  • The smallest building block of a wireless lan is a ______.
    5·1 answer
  • Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
    8·1 answer
  • What is the output of the code snippet given below?string s = "abcde";int i = 1;while (i &lt; 5){ cout &lt;&lt; s.substr (i, 1);
    11·1 answer
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • How do you change your grade level
    10·1 answer
  • Energía de movimiento de los átomos o moléculas
    11·1 answer
  • Koi friend online hai kya​
    15·1 answer
  • Why do we install doorbells in our house
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!