Question: Using online GDB , please extend the C code below, and show a screenshot of the output! The code should simulate and print user login
Using online GDBplease extend the C code below, and show a screenshot of the output!
The code should simulate and print user login records so that the information about the user's terminal is also stored in the file and then printed. Your program output should look like this:
user last logged in on terminal on Mon Jun ::
user last logged in on terminal on Mon Jun ::
user last logged in on terminal on Mon Jun ::
Submit a single C source code file with your work and a screenshot in PNG or JPG format showing the results of executing your program.
The Code:
using structures in C
#include
#include
struct dataRecord a simple structure to represent a person
int intID;
int intAge;
float fSalary;
char strName;
;
print the values of a structure
void printDataRecordconst struct dataRecord p
printfs is d years of age, their salary is f
pstrName, pintAge, pfSalary;
int main
struct dataRecord John; declare an instance of a structure
John.intID;
John.intAge;
John.fSalary;
strcpyJohnstrName,"John";
printDataRecord&John;
John.intAge; change one field within a structure
struct dataRecord alias;
alias&John; create a pointer to a structure
aliasfSalary; access a field within a structure via a pointer
printDataRecord&John;
aliasfSalary;
printDataRecordalias;
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
