[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1768627848452835.jpg (288 KB, 1200x927)
288 KB JPG
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
>>
>>108766475
anon, pointers aren't addresses. this is really embarrassing for you.
>>
>>108766475
A "pointer" stores an "address". It should've been called a softlink or something.
>>
pointer points to an address which in turn points to
a location in memory, which may itself be reserved
for another pointer
>>
>>108766506
address
>>
>>108766505
why call it address?
index is much more fitting
>>
>>108766524
sar i don't understand? did yuo mean to talk this to some other "anonymous"?
>>
>>108766505
Pointers 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 NULL
meds. now.
>>
>>108766556
thanks for agreeing that they are not address
>>
>>108766583
Every 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.
>>
>>108766607
And the integer value stored in a pointer is a fucking address. So why not just call it an address variable?
>>
>>108766475
There 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).
>>
>>108766655
when 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 integers
This 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 pointer
only logical one here tbdesu
>>
>>108766717
Sure, but we're talking about every-day x86 computers.
>>
They should be called symlinks.
>>
>>108766556
it'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 character
bumbling 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
>>
File: 1659383188147694.jpg (62 KB, 660x417)
62 KB JPG
i like big booba
>>
>>108766475
CS 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 value
the value is the id of a memory cell
the memory cell storing the value
>>
>>108766475
>>108766505
why not call them comfusers, or twistlers
for 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.
>>
>>108766514
WHATS IN THE &Named_Pointer!!!
>>
>>108766741
>named for sir arthur boole, who discovered the concept of yes/no in 1886
wtf how did people live before 1886?
>>
>>108768595
Boole's logic system was inspired by Panini's (ca 5th century BC). Panini was a linguist, Noam Chomsky was inspired by his work too.
>>
File: 1746671333240377.gif (14 KB, 308x326)
14 KB GIF
>>108768477
Ah, 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.
>>
>>108768900
youre so cute i want to fuck you
>>
they should be called references
>>
>>108769566
References are a subset of pointers though.
>>
>>108766741

does such thing as accurate decimal number exist
>>
>>108766505
fpbp.
>>
File: happy.webm (3.48 MB, 2000x1544)
3.48 MB
3.48 MB WEBM
Wtf is that shirt's problem?
>>
>>108768595
they wouldn't put up with boole shit
>>
>>108766475
did the journal factory blow up?
>>
>>108766688
Exactly, 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 Complement
none of that shit exists anymore and rightly so
>>
File: 1752366917549150.jpg (273 KB, 768x768)
273 KB JPG
>>108766475
Ada doesn't have this problem
>>
>>108773077
Ada is a worse Java.
>>
>>108771072
Be 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.
>>
>>108766475
There is no confusion about pointers as a concept, everyone gets it immediately
It's the C pointer syntax, that's fucked, and trips people up.
>>
I want a gf with a shirt like that so bad
>>
>>108768595
they use aye/nay prior to that
>>
>>108766475
All 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.
>>
>>108767349
Every-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.
>>
>>108766475
If you're confused by simple terminology, you're a sperg who shouldn't try programming
>>108773077
Fuck 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 BURNT
Here's a string. Tie it around your neck.
>>
>>108768477
>for all the complexity they put into explaining them
>THEY
i'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 definition
a 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
>>
>>108777192
What 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
>>
>>108777215
You sound fat
>>
>>108766475
fat cow tits
>>
Pointers have provenance, addresses don't



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.