Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 . to ->

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
araav Posted - Mar 07 2005 : 03:51:42 AM
A *p;
type p. is changed to p->
type *p. is not changed. bah-bah, not good
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 17 2006 : 12:34:08 PM
have a look at this thread, the code example is a good explanation of when this is a bug:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=3433

personally i agree, using * like this is a bad idea if you want clear and easy to read code. the multiplication example is a better example of why VA should handle this slightly differently.
ether Posted - Apr 17 2006 : 07:19:00 AM
quote:
Originally posted by araav

A *p;
type p. is changed to p->
type *p. is not changed. bah-bah, not good



Wait a minute. How is that a bug?
Suppose you have the following:

class Foo
{
public:
    char * m_pszSomeText;
    .
    .
    .
};

void DoSomething()
{
    Foo * pObj = new Foo;
    pObj->m_pszSomeText = new char[256];
    *pObj->m_pszSomeText = 0; // terminate the string to zero length
}

I would not expect *pObj. to stay *pObj. when I typed the above. If I wanted to access the contents of the class pointer as a reference, then I would type (*pObj). and not *pObj..

The asterisk is a tricky devil and always applies to the last item in the descriptor, unless parens are used.
support Posted - Apr 14 2006 : 11:26:38 PM
Fixed in build 1445.
feline Posted - Mar 07 2005 : 4:17:46 PM
any chance i can get away with "shame on you for using hard to read code"?

case=524

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000