precedence / associativity

This is a discussion on precedence / associativity within the C++ Programming forums, part of the General Programming Boards category; Are my comments regarding the staement below correct. node *top_ptr=create_node(); // () has highest precedence so function called first // ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    41

    precedence / associativity

    Are my comments regarding the staement below correct.

    node *top_ptr=create_node();

    // () has highest precedence so function called first
    // then * indirection operator has second highest precedence so create pointer
    // finally = assignment operator lowest precedence used last
    // to assign whats on the rhs to the lhs ie returned address to pointer.

    Thanks all for taking the time to help me.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Are my comments regarding the staement below correct.
    Basically, yes.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C4554 Warning, check operator precedence for possible error
    By Bassquake in forum C++ Programming
    Replies: 2
    Last Post: 06-05-2008, 06:13 AM
  2. associativity of operators
    By hitesh_best in forum C Programming
    Replies: 2
    Last Post: 08-03-2007, 03:05 PM
  3. precedence problem
    By timhxf in forum C Programming
    Replies: 3
    Last Post: 12-13-2006, 09:10 AM
  4. Replies: 15
    Last Post: 11-04-2006, 04:06 AM
  5. precedence
    By modec in forum C Programming
    Replies: 3
    Last Post: 05-22-2003, 12:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21