Well, look at your code:
Code:
int replaceNibble (int number, int nibble, int value, int newVal)
{
if (d == value)
{
int result, d;
result = newVal;
result = result << 12; /* new value that replace; now write to output.txt file */
d = number ^ result; /* OR to get answer to store to output file */
fprintf(out, "%d", d);
printf("replace and has new number %d\n", d);
return 1;
}
return 0;
}
There is indeed no declaration of a variable called "out" anywhere in that code. If you want to use the out that you have in main, then you need to pass it in to the function with everything else.