Question & Answer: Suppose you were writing a program, that's takes user input line by line. Each input 1-50ch…..

C program

Suppose you were writing a program, that’s takes user input line by line. Each input 1-50charactets. You need to maintain a table, then sort it. Is a 2d array or array of char pointers better? What are the advantages?

Expert Answer

 

Answer for the given Question:

Pointers are more efficient in handling arrays and data tables. They can be used to return multiple values from a function via function arguments.
Pointers permit references to functions and thereby facilitating passing of functions as arguments to other functions.
The use of po0inter arrays to character strings results in saving of data storage space in memory.
pointers allow C to support dynamic memory management. Pointers provide an efficient tool for manipulating dynamic data structures such as structures,
linked lists, queues, stacks and trees. Pointers reduce length and complexity of programs.
They increases the execution speed and thus reduce the program execution time.

Still stressed from student homework?
Get quality assistance from academic writers!