I have the question and the answers can someone explain the concepts to solve these problems and explain why the answers are what they are  consider the decleration below

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I have the question and the answers can someone explain the concepts to solve these problems and explain why the answers are what they are 

consider the decleration below

 

struct rec
(char name[20];
float salary:
} item, recs[10],"temp;
Write the C statement(s) to do each of the following:
1. Read from the keyboard a value for the salary of the variable item.
scanf("%f",&item.salary);
2. Assign to the name field of item the string "Schemp".
strcpy(item.new, "Schemp");
3. Assign to the 2nd character in the name field of the first element of recs the letter B.
recs[0].name [1] = 'B';
4. Assuming that the address of a properly allocated variable of type struct rec has been stored in temp,
assign to the salary field of the variable the value 1000.
temp -> salary = 1000.;
5. Declare fto be a pointer to a function that returns an integer and has a single argument of type struct rec.
This study source was downloaded by 100000798816403 from Coursellero.com on 04-10-2022 08:56:48 GMT-05.00
https://www.courschere.com/file/7583654x20250
page 4 of 8
int(*f) (struct rec);
Transcribed Image Text:struct rec (char name[20]; float salary: } item, recs[10],"temp; Write the C statement(s) to do each of the following: 1. Read from the keyboard a value for the salary of the variable item. scanf("%f",&item.salary); 2. Assign to the name field of item the string "Schemp". strcpy(item.new, "Schemp"); 3. Assign to the 2nd character in the name field of the first element of recs the letter B. recs[0].name [1] = 'B'; 4. Assuming that the address of a properly allocated variable of type struct rec has been stored in temp, assign to the salary field of the variable the value 1000. temp -> salary = 1000.; 5. Declare fto be a pointer to a function that returns an integer and has a single argument of type struct rec. This study source was downloaded by 100000798816403 from Coursellero.com on 04-10-2022 08:56:48 GMT-05.00 https://www.courschere.com/file/7583654x20250 page 4 of 8 int(*f) (struct rec);
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY