hey...this is my code. when i compile, there are no errors but when i run my program, there is this access error that comes up and doesn't let me run my program. my code is in C but compiler used is visual C++.
the error is:
Unhandled exception at 0x0087182e in preeti_newlab9.exe: 0xC0000005: Access violation reading location 0x00000000.
for (k = 0; k <x-1; k++)
{
/* Exchange min with next array value */
m = k;
for (j = k; j < x; j++)
{
if (sort[j] < sort[m])
m = j;
if (m != k)
{
hold = sort[k];
sort[k] = sort[m];
sort[m] = hold;
}
}
}
oh so am i not supposed to initialize it to NULL? but if i don't, i get an error saying undeclared identifier.
that's why i initialized it NULL...
how can i fix this?