We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS201 Assignment # 4 ; Due date 28 Jan 2013

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 3722

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

Solution:

#include <iostream.h>

class Location
{
int l1;
int l2;

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

Location::Location()
{
l1=0;
l2=0;
}

Location::Location(int lon,int lat)
{
l1=lon;
l2=lat;
}
void Location::view()
{
coutendl"Longitude : "l1endl;
cout"Latitude : "l2endlendl;
}
void* Location::operator new(size_t size)
{
void * rtn = malloc (size ) ;
return rtn;
}
Location Location::operator ++()
{
++l1;
++l2;
}
Location Location::operator --()
{
--l1;
--l2;
}
void Location :: operator delete( void *memory )
{
free( memory );
}

main()
{

system("cls");
Location l1(10,20), *l2= new Location(30,40);

coutendl"Coordinates for Location 1:";
l1.view();
++l1;
cout"After applying overloaded ++ operator on Location 1 : ";
l1.view();
cout"Coordinates for Location 2:";
l2[0].view();
--l2[0];
cout"After applying overloaded -- operator on Location 2 : ";
l2[0].view();
delete l2;
system("pause");
}

ye to compile hi nhi ho rhi is me to err hai jnab

ye compile hona b nahi hai.. q k ye relevent asnwer hai he nahi..

itx nt my solution

teel the correct program

ye solution C++ mai kis tara likaingai

ye file c++ mai kis tara hoga convert ka tarika batai

Suspense ended!

Enjoy!

Attachments:

thnks koi error nehi is main

thanks

error hain is main b

## Latest Activity

11 minutes ago
16 minutes ago
16 minutes ago
18 minutes ago
+!!! illegal weapon !!! liked + ! ! cuttiee ! ! +'s discussion hm log
20 minutes ago
+!!! illegal weapon !!! liked иαвєєℓ αнмє∂'s discussion !!!! ROAG AUR BOJH !!!!
22 minutes ago
23 minutes ago
+!!! illegal weapon !!! liked + ! ! cuttiee ! ! +'s discussion paisa
23 minutes ago
24 minutes ago
+!!! illegal weapon !!! liked иαвєєℓ αнмє∂'s discussion !!!!Be-Wafai!!!!!
27 minutes ago
الشيخ وليد updated their profile
47 minutes ago

1

2

3