Connecting Tech Pros Worldwide Forums | Help | Site Map

How to define a property?

wiza
Guest
 
Posts: n/a
#1: Jul 23 '05
if i want to implement the point type in terms of pair<int ,int>, and i
also want to define a member variable named x to access the
pair<int,int>::first member variable.

how can i achiev this goal?i dont want to use memeber function.




E. Robert Tisdale
Guest
 
Posts: n/a
#2: Jul 23 '05

re: How to define a property?


wiza wrote:
[color=blue]
> If I want to implement the point type in terms of pair<int ,int>
> and I also want to define a member variable named x
> to access the pair<int,int>::first member variable.
>
> How can I achieve this goal?
>
> I dont want to use member function.[/color]

We are happy to help you with your homework
provided that you make an attempt yourself first.
Please post the code that you have written so far
and I'm sure you'll get lots of help.
cyrusNew
Guest
 
Posts: n/a
#3: Jul 23 '05

re: How to define a property?



Użytkownik "wiza" <wjxu@mail.ustc.edu.cn> napisał w wiadomości
news:crt1i6$kq1$1@mail.cn99.com...[color=blue]
> if i want to implement the point type in terms of pair<int ,int>, and i
> also want to define a member variable named x to access the
> pair<int,int>::first member variable.
>
> how can i achiev this goal?i dont want to use memeber function.
>
>
>[/color]

you want C# like properties ?


cyrusNew
Guest
 
Posts: n/a
#4: Jul 23 '05

re: How to define a property?



Użytkownik "cyrusNew" <deselect@wp.pl> napisał w wiadomości
news:crtaq6$1bkg$1@mamut.aster.pl...[color=blue]
>
> Użytkownik "wiza" <wjxu@mail.ustc.edu.cn> napisał w wiadomości
> news:crt1i6$kq1$1@mail.cn99.com...[color=green]
>> if i want to implement the point type in terms of pair<int ,int>, and i
>> also want to define a member variable named x to access the
>> pair<int,int>::first member variable.
>>
>> how can i achiev this goal?i dont want to use memeber function.
>>
>>
>>[/color]
>
> you want C# like properties ?
>[/color]

you might make x a class with operator=, and put there all necessery logic.
If thats your HW then this should suffice:)


Closed Thread