What is the correct way to include headers between two files in C -


I think this is a very dumb question, but I have to face a small problem in my program Assuming:

Assume that I have file1.c and file2.c

I am declaring in file1.c and file2.ca struct in file2.c. I am using the function inside the file1.c file. C

So what have I done that I wrote in file1.h and #include "file2.h" in file1.h File1 .h ... but while compiling, I have an infinite loop.

How can I fix this? Thank you

You will see file1.h and file2.h . Something like this

  #ifndef FILE1_H_ #define FILE1_H_ / * ... * code * / #endif / * FILE1_H_ * /    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -