Prog5 - CSc 252 Program 5 Version 1.0 Program 5: Alpha and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 252 Program 5 Version 1.0 1 of 2 Program 5: Alpha and Nonalpha Program due: Thursday, December 1st, 11:59p.m. For this assignment, you will write two functions: alpha and nonalpha . Function alpha : The alpha function will take two arguments. $a0 will contain the address of the first character of a string of characters. $a1 will contain an integer that is the number of characters in the string that $a0 points to. The value in $a1 will be an accurate count of every character including the nul character that marks the end of the string. A nul character is considered neither an alphabetic character nor a non-alphabetic character. The alpha function will create a new string that contains only the alphabetic characters from the original string. To do this, alpha will need to create a local array of characters on its own stack. This is similar to the array of integers used on Program #4. There are two differences. First, the array of integers in Program #4 was always the same size. Here, the array will need to be sized to hold the number of characters in each string. Second, the array this time may need to be expanded to be a size divisible by 4 . This is necessary to insure that functions further down on
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Prog5 - CSc 252 Program 5 Version 1.0 Program 5: Alpha and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online