problem while using extern variable
<pre><code>//FILE 1
char *ptr="Sample";

void SomeFunction() {
  cout&lt;&lt;ptr&lt;&lt;endl;
}

//FILE 2

void SomeFunction();
int main() 
{
  extern char ptr[];
  SomeFunction();
  cout&lt;&lt;ptr&lt;&lt;endl;
}
</code></pre>

<p><code>ptr</code> in the main function is printing some garbage value. please let me know the reason.</p>
