stavor wrote:
if (fp == NULL)
Label1->Caption="Neuspjesno ovaranje fajla...";
Label1->Caption="Ucitan sadrzaj fajla";
Show an error or something, and return control from the function if fopen doesn't return a valid file pointer.
Like the other poster said, you're checking for this error condition, but are ignoring any possible error that could occur!