IN C PROGRAMMING LANGAUGE AND COMMENT EVERY LINE PLEASE SO THAT I COULD UNDERSTAND Write a program that processes a data file of names in which each name is on a separate line of at most 80 characters. Here are two sample names: Hartman-Montgomery, Jane R. Doe, J. D. On each line the surname is followed by a comma and a space. Next comes the first name or initial, then a space and the middle initial. Your program should scan the names into three arrays—surname, first, and middle_init. If the surname is longer than 15 characters, store only the first 15. Similarly, limit the first name to ten characters. Do not store periods in the first and middle_init arrays. Write the array’s contents to a file, aligning the contents of each column: Hartman-Montgom Jane R Doe J D
IN C
Write a program that processes a data file of names in which each name is on a separate line of at most 80 characters. Here are two sample names:
Hartman-Montgomery, Jane R.
Doe, J. D.
On each line the surname is followed by a comma and a space. Next comes the first name or initial, then a space and the middle initial. Your program should scan the names into three arrays—surname, first, and middle_init. If the surname is longer than 15 characters, store only the first 15. Similarly, limit the first name to ten characters. Do not store periods in the first and middle_init arrays. Write the array’s contents to a file, aligning the contents of each column:
Hartman-Montgom Jane R
Doe J D
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images