|
-
February 22nd, 2010, 09:05 AM
#11
Re: [c++] typedef class
The function is also used, but never defined.
Remember that
Code:
class foo {
void DoSomething(void);
};
void foo::DoSomething(void){
std::cout << "Hello World" << std::endl;
}
foo * bar;
main(){
bar -> DoSomething();
}
Is undefined behavior, but stable on almost every compiler.
Also, why do statically declared pointers initialize to zero? Seems like a waste of a mov command to me. I always do this
If I want to know if the pointer has been initialized or not later. If I omit the zero, I don't care what it is.
Last edited by ninja9578; February 22nd, 2010 at 09:07 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|