query on #ifndef _FILENAME_C

  • Thread starter S. Md. Kabeer Ahmed
  • Start date
S

S. Md. Kabeer Ahmed

There are #ifndef _FILENAME_H used in header files and I very well
understand their usage. But I dont know what's the exact use when
#ifndef _FILENAME_C is used for c files. can anyone provide me an
explanation ????

Thanks
Ahmed.
 
U

Ulrich Eckhardt

S. Md. Kabeer Ahmed said:
There are #ifndef _FILENAME_H used in header files and I very well
understand their usage. But I dont know what's the exact use when
#ifndef _FILENAME_C is used for c files. can anyone provide me an
explanation ????

You mean include guards in .c files? I haven't seen such things either, can
you give a concrete example? Note however that C doesn't distinct between
header and source files, so you can very well #include "foo.c", and in
some cases it might make sense. What doesn't make sense in these rare
cases is to add include guards, since those .c files are never included by
other headers and I have never seen a case where one such .c file included
another.

Uli
 
S

S. Md. Kabeer Ahmed

Hi Uli,

Thanks for the quick response Uli. In one of the project I have seen
this and I too wonder whats the purpose of doing this.
Thanks again,
Ahmed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top