Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Photos B.Tech Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




C++ program to perform manipulation using an integer and object using friend functin


Posted Date: 15 Mar 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: ashish singh       Member Level: Diamond
Rating:     Points: 2



//program to perform manipulation using an integer and object.Use friend function//
#include
#include
class num
{
private:
int a,b,c,d;
public:
void input (void);
void show(void);
friend num operator*(int,num);
};
void num::input()
{
cout<<"\n enter values for a,b,c and d:";
cin>>a>>b>>c>>d;
}
void num::show()
{
cout"A="<}
num operator*(int a,num+)
{
num tmp;
tmp.a=a*t.a;
tmp.b=a*t.b;
tmp.c=a*t.c;
tmp.d=a*t.d;
return (tmp);
}
void main()
{
clrscr();
num x,z;
cout<<"\n object x";
x.input();
z=3*x;
cout<<"\n x:";
x. show();
cout<<"z:";
z.show();
return 0;
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C++ program to create a derived class from multiple base classes
Previous Resource: C++ program to declare static member variable count number of object created and destroyed
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources



Watch TV Channels
  • Watch Asianet TV online
  • Kairali TV in Internet
  • Surya TV online
  • Amritha TV Channel

  • Contact Us    Privacy Policy    Terms Of Use   

    SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.