|
Posted by Tim Roberts on 10/16/07 06:10
Jerry Stuckle <jstucklex@attglobal.net> wrote:
>duzhidian@gmail.com wrote:
>>
>> I can organize the codes, but it does not seems as transparent as what
>> c/c++ does as one file at root have to consider it's grandsons'
>> functions (location), not supposed to do that in c/c++.
>
>You're still using relative paths. Anything starting with ".", ".." or
>a path name is relative.
>
>Absolute paths start with / in linux/unix.
>
>It works exactly the same in C/C++. Relative paths there are relative
>to the executable.
You missed the point. He's talking about #include files, and he is quite
correct. In C/C++, you never ever ever use an absolute pathname in an
#include statement. Further, the preprocessor rule is that relative paths
in an #include statement are relative to the directory that contains the
file being scanned.
PHP's rules are different. Not better, not worse. Just different.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Navigation:
[Reply to this message]
|