Representation of 8-Puzzle for (A*) Search Algorithm in C
First of all, the $N$-puzzle is hard to solve with A$^*$ using the Manhattan distance. Instead, we use IDA$^*$. To see the technical details involved in the design of IDA$^*$ specifically for solving the 15-Puzzle see Korf, Richard E. Depth-First Iterative-Deepening: An Optimal Admissible Tree Search, 27 (1985), 97-109. Artificial Intelligence. As a matter of fact, Richard Korf provided a wonderful implementation of his algorithm where he used various tricks to make his solver really fast: a pre-computed table stores the results of all operators to all states; another table stores the variation in the value of the Manhattan distance for each operator, and such. His implementation is publicly available here and you are very welcome to use it provided that you preserve the name of its author, Richard Korf, along with the copyright notice.

If you insist in using A$^*$ for solving the $N$-puzzle then see Matthew Hatem, Ethan Burns, and Wheeler Ruml, Problem Solving with Heuristic Search and Java, IBM developerWorks, July, 2013. The source code is publicly available here. True, their implementation is in Java and their solution considers various issues which are not straight forward in C such as templates. However, most of the ideas are generically discussed (and, indeed, various issues regarding the open and closed lists are considered to a large extent) so that an implementation in C should not be hard.

Finally, let me stress that Manhattan distance is a rather poor heuristic for this domain. On one hand, it can be significantly enhanced with the so called conflict-based heuristic. On the other hand, Pattern Databases are a wonderful means for efficiently solving even the 25-Puzzle (even if some instances can take hours to be optimally solved).

Hope this helps,