What term should I use in English for "dereference" a pointer

Asked

Viewed 92 times

4

As you know in English the term Dereferencing is used to indicate access to the value stored at an address stored on a pointer i and..:

int valor = 10;
int *ptr = &valor;

*ptr = 20; // dereferencing

I have need to use this term in English but have some difficulty in finding a simple way to do it, perhaps dereference, but it doesn’t sound particularly good, and it seems that people aren’t very familiar with it.

My question is, is there a term well-known in Portuguese that you can use?

  • 2

    I see two possibilities, dereference and overreact (compared to, for example, melting). You would have to investigate the etymology of prefixes to see if they match. The idea of the term, in my opinion, is to derive or calculate information (content in memory) from a reference (that although it is often treated as a memory address, it must be considered something abstract pointing to something, and may even be a composite infomation, for example an absolute address plus a delta, depending perhaps on the memory architecture adopted).

  • 1

    Related: https://answall.com/q/507427/357

  • @Piovezan thank you for the information, and you are quite right in the remarks you make, in my particular case it is even more a matter of terminology, that is, in my explanations I need to use this term often.

  • 2

    From the 2nd edition of Kernighan & Ritchie in Brazilian Portuguese: "The unary operator * is the indirect or deferential operator".

2 answers

3


People are not very familiar with this because it is in fact a new knowledge for many people. It is a very strict and new concept in relation to the vocabularies of spoken languages, also.

Which is why, yes, in this case it’s probably best to use a literal translation, although it sounds strange. Dereference, overreact (grammatically more correct in the current spelling reform than de-reference), defer (Brazilian edition of Kernighan & Ritchie, the authors of the language).

The suggestion ai is to use a footnote, after using the adapted term, and in this note:

  1. Put the original word in italics.
  2. Explain what he ago, and not worry too much about the etymology of the thing.

(2) may seem strange, but this is because a possible interpretation in English uses a completely different word: Reinterpret or remap.

A pointer is a pointer, and although it is written down as a type, it is still a mere memory address. A dereferenced pointer is a memory address reinterpreted as something else (the structure or the class), so that the code knows row the memory and thus finding the address of the components of the element or class from the original pointer.

Another reason to use a literal translation is to allow the person get find the term later, in more advanced literatures -- where the term simply is not translated -- or even in the original literature.

  • Yes, they seem to me good advice, being such a common term in the English texts I thought that by now there would already exist a Lexia or canonical way of using the expression.

-1

Good morning! I believe that the most appropriate term in this case is really to dereference. If this sounds strange, try to put a brief explanation together of what this command actually does. I think that at least whoever reads the code will understand, and if they do not understand, a brief consultation already solves.

  • Well, in English it sounds better in fact, note that even, the broker identifies the word as a misspelling, but anyway, it’s what we have.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.