Describe the flaw in the following function.

```
/*
* Forms the plural of noun by adding an 's'.
*/
char *
add_s(const char *noun)
{
char result[100];

strcpy(result, noun);
strcat(result, "s");

return (result);
}
/code}

It returns the address of local storage as the function value. This space is deallocated as soon as the function returns.

Computer Science & Information Technology

You might also like to view...

Most digital cameras use ________ for storage

A) FireWire B) flash memory C) mini-DVDs D) an external hard drive

Computer Science & Information Technology

An absolute cell reference remains the same when it is copied or filled to other cells

Indicate whether the statement is true or false

Computer Science & Information Technology