I was wondering if the following fuction is a safe way to get input from a user (with a specified length).
char *input(int inputSize)
{
char str[inputSize + 2];
/*DO STUFF HERE (i.e. GET INPUT, CHECK IF CODE IS CORRECT, ETC*/
return &str[0];
}
Is there anything that can go wrong here seeing as I'm declaring the array inside the function?