Thread: using c++ in c code

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >No, it is not.
    It depends on how you define equivalent. If you see it as having similar or identical effects but potentially different ways of obtaining those effects (a common interpretation) then using a pointer to simulate a reference is equivalent. Now, if Ancient Dragon had said that the two methods were equal, then you would be right and he would be wrong. But as it is, you're just being overly pedantic. I don't imagine that there was any confusion about what he meant.
    My best code is written with the delete key.

  2. #17
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by Prelude
    >No, it is not.
    It depends on how you define equivalent. If you see it as having similar or identical effects but potentially different ways of obtaining those effects (a common interpretation) then using a pointer to simulate a reference is equivalent. Now, if Ancient Dragon had said that the two methods were equal, then you would be right and he would be wrong. But as it is, you're just being overly pedantic. I don't imagine that there was any confusion about what he meant.
    Sigh.

    You're suggesting that I'm pedantic in using a "common interpretation", and then using a very pedantic but (in your view) obvious view of why my statement is incorrect.

    Anyone who applies "a common interpretation" to Dragon's words could have been easily misled. I agree he was not incorrect, but there was enough potential for people to misunderstand that I considered it worthwhile pointing that out.

    Your view of what is "obvious" is based on some fairly specialised knowledge. People who lack that knowledge will be fairly easily misled.

    In a court of law, the litmus test of "reasonable" is something like "how would the majority of sane people interpret this statement". People who interpret statements in a highly specialised (or not "common") way tend to be the ones who are found to be misleading others --- and therefore the ones who lose in legal proceedings.

  3. #18
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Saying that 'int *function()' and 'int &function()' are equivalent definitely implies that you can use function() the same way, which is untrue. Sure, it can be taken mean something else, but that requires ignoring the words that were written.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM