Question: mips Write a program that implements the following C code: / / This can be a global variable declared using the . asciiz directive. char

mips
Write a program that implements the following C code:
// This can be a global variable declared using the .asciiz directive.
char * my_string = "hello";
int main()
{
// Call our replace_start_with_z function on our global string.
replace_start_with_z(my_string);
// Print our global string. Use the function in util.s for this.
PrintString(my_string);
// It is generally a good idea to return 0 from main when no errors
// occurred. However, the autograder will not test you on this.
return 0;
}
void replace_start_with_z(char * string_to_change)
{
int length = strlen(string_to_change);
if (length >0)
{
string_to_change[0]='Z'; // Change the beginning character
// to a capital Z.
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!