Skip to content
EntityQ1334113· pop 27· linked from 469 articles

Also known as reference, reference type, reference datatype

ett värde som ger indirekt tillgång till t.ex. en variabel eller ett register

Described at

Pointers and References in C++ - GeeksforGeeks

Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more., Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

geeksforgeeks.org

Pointers store memory addresses and provide indirect access to data. References create an alternative name for an existing variable. Both are commonly used for efficient parameter passing and data manipulation. Pointers are variables that store the memory address of another variable. They provide direct access to memory locations and are commonly used for dynamic memory allocation, efficient parameter passing, and implementing complex data structures. Store the address of a variable or memory location. Can be reassigned to point to different variables. Can store a nullptr value when not pointing to any valid memory location. Require the dereference operator ( ) to access the value stored at the address. Have their own memory address independent of the variable they point to. Pointers and references are both used to access and manipulate data indirectly, but they differ in how they store and refer to memory. The following table highlights the key differences between pointers and references in C++.

Excerpt from a page describing this subject · 11,130 chars · not written by Vinony

Wikidata facts

Has use
reference
Show 1 more fact
Sources (1)

via Wikidata · CC0

Article · Svenska

Referenser är inom datavetenskap ett sätt att indirekt hänvisa till en variabel eller annat objekt i ett program. Referensen kan vara explicit (en pekare eller adress) eller implicit (någon mer transparent mekanism). På implementeringsnivå är det dock alltid fråga om en pekare eller ett index som adresserar objektets (variablens) . Precis som för många andra datalogi-termer, så kan nomenklaturen vara något vacklande (på svenska såväl som på engelska).

Abstract from DBpedia / Wikipedia · CC BY-SA