bar.c:6:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
bar.c: In function ‘main’:
bar.c:22:2: warning: passing argument 1 of ‘fwrite’ makes pointer from integer without a cast [enabled by default]
Editing out your topic after it's solved is a jerk move, you should refrain from doing that in the future. Others may have had the same problem as you, and now they can't solve it because they can't confirm their error(s).