/* * shout.c - implementation of module to write messages to stdout loudly * CSE333 demo, Hal Perkins */ #include #include #include #include "speak.h" #include "shout.h" /* Write message m in uppercase to stdout followed by a newline */ void Shout(char m[]) { int len; /* message length */ char* mcopy; /* copy of original message */ int i; len = strlen(m); mcopy = (char*) malloc(len * sizeof(char) + 1); strcpy(mcopy, m); for (i = 0; i < len; i++) mcopy[i] = toupper(mcopy[i]); Speak(mcopy); free(mcopy); }