Hi, could someone explain what the ':' operator does. I know it's used in inheritance and know how to do that however, i've seen it used on a class's constructor with no inheritance which doesn't make any sense to me; what does it do/mean?
Microsoft provides a definition of it, as follows:
operator :
segment : expression
Overrides the default segment of expression with segment. The segment can be a segment register, group name, segment name, or segment expression. The expression must be a constant.
...but I don't think it really explains a lot. Could someone expand on it; perhaps with an explained example.
Thanks for any help.
(Sorry if there has already been a similar post)
[edit] The following refers to programming with C and C++ [/edit]
It should be noted that :is not technically an operator.
It is a lexical element, yes, but not an operator.
[edit] The following refers to programming with MASM and other like-minded x86 Assemblers [/edit]
That old MS documentation (which, btw, looks like it came out of a MASM manual) refers to the way in which assemblers override the default segment with a chosen one. For example, anything working with SI is typically working in the DS segment. However, you may wish to point SI at something in the ES segment. Hence, [SI] is equivalent to [DS:SI], but there is only one way to express [ES:SI]. (An alternate notation is ES:[SI].)