EGRE 246 Introduction to Programming Using C Homework #2 – Pointers and Dynamic Memory Allocation

$30.00

Category: Tags: , , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

1) Write a C program that reads in a list of letters, sorts them alphabetically and prints
them to the screen. The program must adhere to the following specifications:
a) The program must ask the user how many letters can be expected.
b) The program then should ask the user for all the (capital or lower-case) letters and
should make sure the letters entered are valid letters (and not symbols).
c) Capital letters should be sorted before lower-case letters.
d) Your program must use dynamic memory allocation for all arrays needed. In
addition, pointers must be used for all operations that access the array(s). Thus,
your program must not include any square brackets (‘[‘ or ‘]’) anywhere in the
code.
e) You program cannot allocate more memory than needed.
f) Your program must consist of a main()function, a sort(char *a, int
size) function, and a swap(char *x, char *y) function.
g) Any dynamic memory allocated must be freed before the program exits.
For this assignment, you must turn in a zip file with all of your C header files, source
code files, and a working Makefile to compile your solution. Turn in your assignment
by attaching the zip file to the assignment submission page.
Remember the class policy on late submissions – no late submissions are allowed
unless prior arrangement is made with the instructor.