Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

#include <iostream.h>

class Location
              int l1;
              int l2;
              Location(int lon,int lat);                    
              void view();                              
              Location operator ++();                   
              Location operator --();                   
              void* operator new (size_t size);         
              void   operator   delete( void *   ptr );
Location::Location(int lon,int lat)                 

void Location::view()
                       coutendl"Longitude : "l1endl;
                       cout"Latitude : "l2endlendl;

void* Location::operator new(size_t size)
                       cout"Overloaded new operator called....." endl;  
                       void *   rtn   = malloc (size ) ;
                       return   rtn;    

Location Location::operator ++()

Location Location::operator --()

void   Location :: operator   delete( void *memory )
                       cout"Overload delete operator called....."endlendl;
                       free( memory );



                       Location l1(10,20), *l2= new Location(30,40);
                       coutendl"Coordinates for Location 1:";
                       cout"After applying overloaded ++ operator on Location 1 : ";
                       cout"Coordinates for Location 2:";
                       cout"After applying overloaded -- operator on Location 2 : ";
                       delete l2;


Views: 2313


Replies to This Discussion

greet jazakallah

Good Work Brother

well done but one problem occur when it compiled and further continue when press any key. plz make it clear to me. thanx

AOA, bhaai MashaALLAH good work but compilation main error arahay hain please is ko clear kardain.

Thank u so much bhaiya..... but i need ur help to learn c++ its quire difficult 4 me to solve an assignment.i hope u will guide me..


now its compile and run fine...


thank u soo much dear................

thanks muzamil

but yah v compile nhi hoo rhi

no need of thanks....if u have any problem with in this file tell me...

thnx broooooooooooooooooo

ye assignment gaalat hai us ne value object k through mange hai laken is me to assignment k through dia hai value


Looking For Something? Search Below

Latest Activity

saba zulfqar posted a blog post
39 minutes ago
saba zulfqar and Hania Khalid Shariff are now friends
2 hours ago
Muhammad Kasim replied to Sunny's discussion fin622 MCQS needed
3 hours ago
Profile IconMuhammad Kasim and shahzad Hussain joined Virtual University of Pakistan
5 hours ago
Mr Siren Head replied to Hania Khalid Shariff's discussion zero semester
7 hours ago
Hania Khalid Shariff and Huma Ahmad are now friends
17 hours ago
Huma Ahmad liked Hania Khalid Shariff's profile
18 hours ago
BBA(6th smes) left a comment for Rimsha mujahid
19 hours ago

VIP Member Badge & Others

How to Get This Badge at Your Profile DP


Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service