Functions are global by default - that is they are seen across all files.
To make a function visible/available only within the file in which it is defined, then you can make the function static.
For example: file1.cpp
1 2 3 4 5 6 7 8 9 10 11
//static function only available within file1.cpp
staticvoid abc();
.
.
.
void abc()
{
}
file2.cpp
1 2 3 4 5 6 7 8 9 10
//Global function - seen across all files
void abc() ;
.
.
void abc()
{
}
Thanks, it works like a charm
But i get another similar problem.....
how if i hv complied first.ccp and sencond.cpp to first.o and second.o
is there any way to make abc static now?
Just change your files and do a rebuild - so it recompiles all files.
( Rebuild all from the execute menu in dev++, or rebuild solution from the build menu in MSVC)
Alternatively, I think you could use an anonymous namespace. I know that they are C++'s way of providing module-scope for variables, but I haven't tried it with functions...