Search code examples
ctype-conversioninitializationarguments

What are potential issues with the following code? short foo() { short a,b,c; b=10; c = a + b; return c; }


What are potential issues with the following code?

short foo()
{
    short a,b,c;
    b=10;

   c = a + b;

   return c; 
 }

Solution

  • Variable a was not initialized. It has an indeterminate value.