+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Tags:
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)hahaha...wah kia bat hai zero marks...
plz tell the sol of todays assign
#include<iostream>
using namespace std;
class Location
{
private:
int longitude;
int latitude;
public:
void display()
{
cout"Longitude = "longitudeendl"Latitude = "latitudeendl;
}
int setLongitude(int i)
{
longitude=i;
}
int setLatitude(int i)
{
latitude=i;
}
Location()
{
longitude=10;
latitude=20;
}
Location(int i, int j)
{
longitude=i;
latitude=j;
}
Location operator ++()
{
++longitude;
++latitude;
}
Location operator --()
{
--longitude;
--latitude;
}
void* Location::operator new(size_t size)
{
cout"Overloaded new operator called..."endl;
void * p=malloc(size);
return p;
}
void Location::operator delete (void *p)
{
cout"Overload delete operator called...";
Location* pc=static_cast<Location*>(p);
free(p);
}
};
main()
{
Location *p, a, b(30,40);
p=new Location(1,2);
coutendlendl"Coordinates for Location 1:"endl;
a.display();
coutendlendl"After applying overloaded ++ operator on Location 1:"endl;
++a;
a.display();
coutendlendl"Coordinates for Location 2:"endl;
b.display();
coutendlendl"After applying overloaded -- operator on Location 2:"endl;
--b;
b.display();
coutendlendl;
delete p;
system("pause");
}
plz try it wil work
need some syntax complition
is it the right solution nd complete.......plz tell na
it is right bt not complete
if u have a command on c++ so add < these sign as where thy r needed
thn it wil complete jawairiah baji
& use little mind & get hands on c++ it will work out betr in life
Great work sis sadaf , peace and blessings is what i pray ur life to be with, great way to share idea solution as well as to let students do their own home-work. Cheeeers
Friends checks it
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post