Which lolsorandum faggot decided to call them "pointers" instead of simply "addresses"? Half the confusion is because of the retarded name. >Haha it's a pointer! It points! Fuck you
>>108766475anon, pointers aren't addresses. this is really embarrassing for you.
>>108766475A "pointer" stores an "address". It should've been called a softlink or something.
pointer points to an address which in turn points toa location in memory, which may itself be reservedfor another pointer
>>108766506address
>>108766505why call it address?index is much more fitting
>>108766524sar i don't understand? did yuo mean to talk this to some other "anonymous"?
>>108766505Pointers are just address variables.
>>108766506>thing that stores integer is called integer>thing that stores character is called character>thing that stores address is called pointer ???
>>108766524>>108766475>>108766556>uhm actually this is an address to the void at NULLmeds. now.
>>108766556thanks for agreeing that they are not address
>>108766583Every variable stores integers, the interpretation of that integer is determined by the type of the variable. Value types stores their values directly, pointer types point to other variables through their addresses. The type determines interpretation and usage, not the underlying value.
>>108766607And the integer value stored in a pointer is a fucking address. So why not just call it an address variable?
>>108766475There is no requirement that a pointer be restricted to addresses. Not even in C or C++. In BCPL (the predecessor to B and C) the value stored in a pointer variable was not the address it referenced (it held the address right shifted several bits). And in ansi C the null value isn't required to be an address (not is it required to be 0 which is a common misconception) and in some ANSI conforming implementations it isn't. (Symbolics C comes to mind).
>>108766655when pointers were invented you had segment addresses which were not pointers or variables or whatever, they were registers. and pointers were offsets to the segment address, they were not addresses themselves, even if they are today, the word was already chosen and you can't go back, sorry.
>>108766607>Every variable stores integersThis isn't true. There are machines out there that support other types as fundamental. HP has a line of mini computers that use a decimal type as its basic data type, and the Cray supercomputers used its floating point as its fundamental type. And there are cpus out there that include metadata alongside every register indicating what type that value is, and operations on that register are restricted to valid operations for that type.
>>108766583>thing that stores a whole number is called an int>thing that stores a decimal number is called a float>thing that stores a decimal number accurately is called a double>thing that stores a big whole number is called a long>thing that stores a yes/no is called a bool (named for sir arthur boole, who discovered the concept of yes/no in 1886)>thing that points at things is called a pointeronly logical one here tbdesu
>>108766717Sure, but we're talking about every-day x86 computers.
They should be called symlinks.
>>108766556it's not just an address, it also has an associated type and size, that way you can do "pointer+1" and it won't add 1 to the address, it will add whatever the size of the data being pointed at is
>>108766583>thing that stores integer is called integer>thing that stores character is called characterbumbling fuckwit moron theres no "thing that stores" integer and characters are simply just integers and characters. go fucking take cs50 before making retarded threads.
rude chest
i like big booba
>>108766475CS niggers are known for being sheltered and know nothing of language. The faster a field grows the more terminology they mix up, can't come up with their own nomenclature like real science does.
In an alternate universe>Which lolsorandum faggot decided to call them an "address" instead of simply "pointers"? Half the confusion is because of the retarded name.>>Haha, it's like an address! Like a house!>Fuck you
is a variable that store a valuethe value is the id of a memory cellthe memory cell storing the value
>>108766475>>108766505why not call them comfusers, or twistlersfor all the complexity they put into explaining them, when just saying, "they reference memory addresses" would've sufficed, hence "they point", "pointers"they make the whole ordeal more complicated than it ever needed to be.they just point, that's it.
>>108766514WHATS IN THE &Named_Pointer!!!
>>108766741>named for sir arthur boole, who discovered the concept of yes/no in 1886wtf how did people live before 1886?
>>108768595Boole's logic system was inspired by Panini's (ca 5th century BC). Panini was a linguist, Noam Chomsky was inspired by his work too.
>>108768477Ah, but what does it mean in computing, to point?You tell a man, "this is a pointer", his next question is likely, "what does pointing do?".You tell a man, "this is an address", his next question is likely, "what, like to my house?".Null is then off the edge of a cliff.You point a man off the edge of the cliff, he's likely to follow your finger blindly.You give the man an address off the edge of the cliff, he's likely to tell you to fuck off.We've lived through decades of OOP; you don't trust simple words to mean simple concepts.Not in this world of inheritance, encapsulation and polymorphism.I've lost my train of thought. It's late.
>>108768900youre so cute i want to fuck you
they should be called references
>>108769566References are a subset of pointers though.
>>108766741does such thing as accurate decimal number exist
>>108766505fpbp.
Wtf is that shirt's problem?
>>108768595they wouldn't put up with boole shit
>>108766475did the journal factory blow up?
>>108766688Exactly, a pointer is a collection of bits that is used to construct an address. For example, ILP32 on ARM64 zero extends 32 bit values into 64 bit registers (addresses), and MIPS64 n32 sign extends. Various historical platforms have thunked (alternate transform) different width bit patterns for compatibility, and things like TLS (thread local storage) can do other transforms, like (on x86-64) using alternate segment registers (%fs) for final addresses that are never actually calculated fully (because the processor has explicit segment addressing built in, making calculation of the final address inefficient, as it would take an extra step and be the exact same).So pointers really are C AST context (i.e., is this TLS or an explicit address space pointer?) plus bits in the pointer plus an arbitrary but efficient transform that allows direct _use_ of something memory-like but that may never actually be a final address like a bunch of faggots here are sperging out about.
>>108770460 (me)I meant to scare quote that first "address", then explain how it doesn't have to be an actual address, as in a final numeric value, I guess I'm the faggot after all.
>retards ITT unironically using the "NUH UH but some 1970s Unix shitbox used this weird pointer format so that means you're WRONG">Muh Lisp machines>Muh PDP-11>Muh CHAR_BIT != 8>Muh Big Endian>Muh One's Complementnone of that shit exists anymore and rightly so
>>108766475Ada doesn't have this problem
>>108773077Ada is a worse Java.
>>108771072Be that as it may, that is in fact the reason it's called a pointer. C is a language that describes abstract machines that can be implemented by many different types of physical hardware, and a pointer need not be an address in that abstraction. Yes, it is an address in unsegmented x86. No, that's not what C is designed for, now or then.
>>108766475There is no confusion about pointers as a concept, everyone gets it immediatelyIt's the C pointer syntax, that's fucked, and trips people up.
I want a gf with a shirt like that so bad
>>108768595they use aye/nay prior to that
>>108766475All variables are actually addresses. Compiler turns one into another. Assembly languages were introduced to let programmers use command and variable names instead of hardcoded machine instructions and memory addresses. Then assemblers (human ones) performed the substitutions suitable for specific computer, put code at the certain position in memory, grouped variables at some other place, resolved jump labels (which are no different from variables because they are also just addresses).So pointer is a type of a thing that supposedly exists at the memory address corresponding to a variable called p in source.
>>108767349Every-day x86 computers support 3 different modes of operation for 16-, 32- and 64-bit code (actually, more than that because of vairious memory models). Word widths and addressing are different in all of them.
>>108766475If you're confused by simple terminology, you're a sperg who shouldn't try programming>>108773077Fuck you nigger
>>108774240>So pointer is a type of a thing that supposedly exists at the memory address corresponding to a variable called p in source.In the general case, there is no requirement that a variable be allocated a unique memory location, or even actually exist (optimized out). In general, theonly thing you can concretely reason about as being guaranteed unique memory storage is extern "global" variables.
>>108768900>his next question is likely, "what, like to my house?"What kind of faggot retard can't understand context?>this is a float>HURR DURR HOW DOES IT STAY IN THE AIR LIKE THAT>this is a double>HURR DURR I ORDERED A SINGLE>this is a char>HURR DURR IS IT BURNTHere's a string. Tie it around your neck.
>>108768477>for all the complexity they put into explaining them>THEYi'd insult your intelligence, but evidently you were failed by your education, unable to get the concise idea behind pointers and stuch only half-understanding the bulky definitiona sadly common occurrence(unless you fancy yourself some autodidact and have never actually tried to ask the question from a living human bean, in which case it is you who is indeed the retard)
Guys wtf is a pointer im stupid
>>108777192What is greater than greater than 108777192 in the line above? It's akin to a pointer to your post.
if this is the state of the modern programmer we are well and truly fucked
>>108777215You sound fat
>>108766475fat cow tits
Pointers have provenance, addresses don't