Announcement

Collapse
No announcement yet.

Notice: variable 'msgPtr' is being indexed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Notice: variable 'msgPtr' is being indexed

    HTML Code:
    var ID;
    var *msgBuf;
    ......
    
    msgPtr := str_Ptr(msgBuf);
    ID := msgPtr[0];
    When compiling this code I get the following message from the compiler"Notice: variable 'msgPtr' is being indexed"Does that mean, I should better not index the string pointer msgPTR ?

  • #2


    Not at all. 'Notice' is just like 'Information' in some compilers, just to let you know in case you meant something else
    Mark

    Comment


    • #3


      OK, I just thought that indexing a string pointer could be a "bad" practice for some reason.

      Thanks,
      ERIC

      Comment


      • #4


        Yes, compiler is just notifying you that the var that holds the address has not been declared as a pointer.

        Just place a * in front of the variable being used as a pointer and it will suppress the messages.

        There is really no difference between a pointer and a normal variable (var) but the compiler likes to know that you know the difference....
        Regards,
        Dave

        Comment


        • #5


          Thanks Dave. I'll give it a try.

          Comment

          Working...
          X