473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to define a property?

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.

Jul 22 '05 #1
3 1359
wiza wrote:
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.


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.
Jul 22 '05 #2

Użytkownik "wiza" <wj**@mail.ustc.edu.cn> napisał w wiadomości
news:cr**********@mail.cn99.com...
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.


you want C# like properties ?
Jul 22 '05 #3

Użytkownik "cyrusNew" <de******@wp.pl> napisał w wiadomości
news:cr***********@mamut.aster.pl...

Użytkownik "wiza" <wj**@mail.ustc.edu.cn> napisał w wiadomości
news:cr**********@mail.cn99.com...
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.


you want C# like properties ?


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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank | last post by:
Hello, i have a form for different uses. So my form should have as DialogResult 'Button1', 'Button2' and so on instead of 'No', 'Yes' or other predefined Results. Does anybody knows, how to...
5
by: Sharon | last post by:
I wand to define a delegate that will have the form a property and not a method. Let say I have a property: public int myProp { get { return 0; } set {} }
0
by: Lloyd Dupont | last post by:
1. I have define A custom web control with, let's say, a property called Content, when I use it like that: <lloyd:MyControl runat=server> <Content>some content</Content> </lloyd:MyControl> ...
0
by: Jonah Olsson | last post by:
Dear Sirs, I'm looking for a way to define a class using an XML file. Since I'm building a Web Service to be used by several customers I want to be able to easily change the class below without...
5
by: han zhiyang | last post by:
Hi. I tried to design a custom web control which can flexibly and dynamicly let the control user ,for example the web page developer, customize its layout codes.This control derives from...
6
by: Kay | last post by:
Hi all, In vb6, I can define a custom type like this: Private Type uClient sName As String sMonday As Double sMondayHeadCnt As Integer End Type
15
by: Ben Hinkle | last post by:
I'm curious, what was the rationale for making a builtin type _Bool but then having #define true 1 #define false 0 in stdbool.h? That seems very odd that true and false don't have type _Bool. In...
6
by: Cylix | last post by:
I just know the form like: myObject.prototype.linkFade = function(link, doShow) { .... .... .... }...
3
by: shapper | last post by:
Hello, I am creating a web control, in VS 2005, and I want to define sub categories in my properties. I know how to define a category: <Bindable(True), Category("Appearance") ... But how to...
1
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hello, friends, In our c#.net 2005 project, I clicked on project property. At application tab of property page, clicked on Assembly Information... button, All boxes were left blank, including...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.