Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is the text file c programming and only use functions given 1. Below you are given some code that will read in student data

image text in transcribed

image text in transcribed

this is the text file

image text in transcribed

c programming and only use functions given

1. Below you are given some code that will read in student data from the ice9.txt file. Your task is to add a loop at the end that will call print_student for every student. You must also complet eprint student so that it prints out the name and the major. The major must be printed as a string not a number. #include # include #include typedef enum (EE, CMPE, CSE, BME) major type; struct student ( char * name ; major type major; void print student (struct student sp) int main (int argc, char "argv) if (argc != 2 ) filename ", argv[O); printf ("%s exit (0) FILE *fp # fopen (argv EU, "r"); pezror ("Could not open file) exit(0): int num students char strr11] int major: struct student "me calloc (10, sizeof (struct stdentt)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

4-7. What is a purpose-driven business?

Answered: 1 week ago