由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] why use static function here?
相关主题
修改环境路径的问题。non-aggregate type问题
有懂obj-c 的吗?Global(static) variable initialization question
Visual Studion 10, C++ string问题:表现不一致static function and static variable?
should the .dll and .lib have the same name?When are data members initialized? what about static data m
a PERL opendir/readdir question[合集] 为什么不能: declare a static memeber func
Re: can destructor be static?一个简单的算法问题?
why use static function here?有没有static return type和static as function arguement?
Test your C++ knowledge...How to change the Static Font size and color of title in GUI in C
相关话题的讨论汇总
话题: directory话题: static话题: dir话题: newpath
进入Programming版参与讨论
1 (共1页)
b***y
发帖数: 2799
1
☆─────────────────────────────────────☆
gebitan (job, job) 于 (Fri Sep 9 12:31:54 2005) 提到:
I am confusing what is the point to use static function here.

class Directory
{
string d_currentPath;
public:
static void preset(Directory &dir, char const *path);
};

void Directory::preset(Directory &dir, char const *newpath)
{
dir.d_currentPath = newpath; // ok
}
int main()
{
Directory dir;
1 (共1页)
进入Programming版参与讨论
相关主题
How to change the Static Font size and color of title in GUI in Ca PERL opendir/readdir question
how to link DLL staticly in visual c# ?Re: can destructor be static?
c 里面的local static variablewhy use static function here?
在 linux下有没有可能得到完全的fully static binaryTest your C++ knowledge...
修改环境路径的问题。non-aggregate type问题
有懂obj-c 的吗?Global(static) variable initialization question
Visual Studion 10, C++ string问题:表现不一致static function and static variable?
should the .dll and .lib have the same name?When are data members initialized? what about static data m
相关话题的讨论汇总
话题: directory话题: static话题: dir话题: newpath