how to call the member function?( C++ ) . or ->
2010-02-05 14:30
471 查看
// Declare a new object of type Point. Point ptOrigin; // Member function calls use the . member-selection operator. ptOrigin.SetX( 0 ); ptOrigin.SetY( 0 ); // Declare a pointer to an object of type Point. Point *pptCurrent = new Point; // Member function calls use the -> member-selection operator. pptCurrent->SetX( ptOrigin.GetX() + 10 ); pptCurrent->SetY( ptOrigin.GetY() + 10 );
X xobj;xobj.set_i(11);xobj.print_i();// static data members and functions belong to the class and// can be accessed without using an object of class XX::print_si();X::set_si(22);X::print_si();Technorati : . or ->
相关文章推荐
- How to separate the implementation and definition for template function in c++
- C# 调用c++错误A call to PInvoke function has unbalanced the stack
- How to call C/C++ sytle function from C# solution?
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- (NOT CLEAR)Question 44: What member function of std::fstream could a C++ developer invoke in order to change the target output f
- How To Call Run() Method of the Microsoft Script Control in C++
- How to call the EnumJobs function from a Visual Basic .NET application
- how to call c++ function in python coding in linux?
- 【ERROR_2】Call to a member function bind_param() on a non-object
- ECmall错误:Call to a member function get_users_count() on a non-object in /home/dmg/wwwroot/includes/ecapp.base.php
- How to change the text color of the selected property sheet tab in Visual C++
- How do you copy the contents of an array to a std::vector in C++ without looping? (From stack over flow)
- Programming Basic--why we need to add ' extern "C" ' in C++ program when calling the function which is complied by C complier?
- Fatal error: Call to a member function read() on a non-object in
- magento 第四章 出现 "Fatal error:Call to a member function load() on a non-object in \Abstract.php" 问题
- [ZT]Member Function Pointers and the Fastest Possible C++ Delegates
- How to use the function of assembly.
- magento后台 Fatal error: Call to a member function getId() on a non-object in错误
- Mailbag: How to detect the presence of the Visual C++ 9.0 runtime redistributable package