View Single Post
  #5 (permalink)  
Old 11-21-2007, 01:57 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,122
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by akshay_pirate View Post
well buddy,-> operator is used when you want to use data members or member functions of a class using that class's object's pointer.
ex:


class C{
public:
int x;
void get(int a){
x=a;
}
};
void main(){
C c;
C *c1;
c1=c;

c1->a(3);
cout<<c1->x;
}
what's the difference with this then:

Code:
void main() {
 C c;
 c.a(3);
}

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote