Lab 9: Malloc -- 3/24/2020

COSC 2200, Spring 2020

Marquette University, Department of Computer Science

Description

In our ninth lab, you and your partner will use malloc to build a simple ARM program. This is a vital concept to understand for your current assignment.

Steps

Find your lab partner. Then:

The Program: Backwards Printer

Write a program that reads an arbitrary amount of integers from the user (using getInt), and prints the entered integers in reverse order. The first input is the amount of numbers to be entered. This is very similar to yesterday's in-class malloc() demo.

Example 1:

	Number of integers? 5
	Integer 0? 1
	Integer 1? 2
	Integer 2? 3
	Integer 3? 4
	Integer 4? 5
	5
	4
	3
	2
	1
	
	All user process have completed.
	

Example 2:

	Number of integers? 16
	Integer 0? 33
	Integer 1? 44
	Integer 2? 55
	Integer 3? 345
	Integer 4? 23
	Integer 5? 43
	Integer 6? 654
	Integer 7? 76
	Integer 8? 87
	Integer 9? 999
	Integer 10? 88
	Integer 11? 777
	Integer 12? 45
	Integer 13? 3332
	Integer 14? 23
	Integer 15? 12
	12
	23
	3332
	45
	777
	88
	999
	87
	76
	654
	43
	23
	345
	55
	44
	33

	All user process have completed.