Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

On a scale from 0 to 1

Name: Anonymous 2015-09-28 22:32

How based are your arrays?

Name: Anonymous 2015-09-28 23:03

2

Name: Anonymous 2015-09-28 23:12

The basis of all arrays is 1 (1 element.)

The origin is zero.

Name: Anonymous 2015-09-29 3:16

True hackers start at 0

Name: Anonymous 2015-09-29 11:17

I do not use arrays, only lazy lists

Name: LilB 2015-09-29 11:23

Name: Anonymous 2015-09-29 17:38

One. The first element should always be at one. That's why it's called the 1st element. Only a retard would claim that the 1st is at the 0th position. What the fuck does that even mean? Dennis Ricky got that one dead wrong, and so have all it's spiritual descendents.

Name: Anonymous 2015-09-29 19:32

>>6
I think a) is only good when the lower bound is fixed at 0.

c) is clearly the best for ranges and array indices that can start anywhere (like "a".."z" or 0..255).

Name: Anonymous 2015-09-29 20:10

>>7
But what about the offset?

Name: Anonymous 2015-09-29 20:21

>>9
0 is the null pointer.

Name: Anonymous 2015-09-29 20:35

>>10
The null pointer is a tool of the cavemen.

Name: Anonymous 2015-09-29 20:50

>>10
0 is the null pointer.
Nope. Integer literal 0 can be casted to a pointer type, producing a NULL pointer. DA STANDAH says nothing about the actual representation of a NULL pointer, what it actually "is".

In fact if I remember correctly it doesn't even say anything about converting a non-literal zero (that is, a 0 value of a variable) to a pointer, at least not explicitly. By the way, figuring if DA STANDAH nevertheless implicitly guarantees that you can do that (via interaction with other rules) would be a good problem for an aspiring C Standard Lawyer to cut xir teeth on.

Name: Anonymous 2015-09-29 21:03

>>12
xir
*their

Name: Anonymous 2015-09-29 21:08

>>13
Have you nothing better to do than go around correcting people's pronouns? It's just a word, lighten up and learn to take a joke, jeeeeez.

Name: Anonymous 2015-09-29 21:11

>>13
Also wtf with "their", shouldn't it been "his", as per Standard Imaginary English? Looks like SJWs already infiltrated your mind, lol.

Name: Anonymous 2015-09-29 21:23

>>15
http://www.oxforddictionaries.com/us/definition/american_english/they
The word they (with its counterparts them, their, and themselves) as a singular pronoun to refer to a person of unspecified sex has been used since at least the 16th century

Name: Anonymous 2015-09-29 21:53

>>16
https://en.wikipedia.org/wiki/Freemasonry#Origins
The minutes of the Lodge of Edinburgh (Mary's Chapel) No. 1 in Scotland show a continuity from an operative lodge in 1598 to a modern speculative lodge.[41] It is reputed to be the oldest Masonic lodge in the world.[42]

Name: Anonymous 2015-09-29 21:55

Their considered harmful.
Seriously, when people use they, I am unable to understand if they talk about one or more people.

Name: sage 2015-09-29 22:20

>>18
I have the same problem with `you.' No wait, I don't, because I speak English and don't struggle to understand the meaning of any among the 100 most common words in the best language spoken on God's green Earth.

Name: Anonymous 2015-09-29 22:35

>>18
They need to be killed.

Name: Anonymous 2015-09-29 23:02

>>19
I have the same problem with `you.' No wait, I don't, because I speak English and don't struggle to understand the meaning of any among the 100 most common words in the best language spoken on God's green Earth.
Your first mistake is not being autistic.

Name: Anonymous 2015-09-29 23:08

Though to be fair I'm all for resurrecting thou/thee/thy/thine. I wonder if there's a crank or several who feel really strong about that and use them all the time, alone against the whole world. Like that bitcoin dude with "tonal system" obsession (that's hexadecimal for pseudo-weaboos).

Name: Anonymous 2015-09-30 12:46

>>22
How does that solve the problem with `their'?

Name: Anonymous 2015-09-30 13:59

If singular "their" bothers you and the rest of English doesn't, I don't know what to say.

Name: Anonymous 2015-09-30 17:11

>>24
English is like 8 bits per byte, or xml, or json, or html: it's the standard even if it is bad.

Name: Anonymous 2016-08-28 4:11

>>7
You're assuming data is a point, when in fact it spans from beginning to end. And array element are accessed by the address of the beginning. The FIRST element is the one that goes from 0 to 1. The second goes from 1 to 2. And so on.

Name: Anonymous 2016-08-28 4:39

The first element of an array is the address of the array+0
or Array[0] or *(Array+0). That was the rationale for 0-based arrays.

Name: Anonymous 2016-08-28 12:11

>>26
Arrays are maps, like hash tables and "pure" functions (which should really just be called functions). They map an index to a value.

People who use one-based (or arbitrary based) arrays look at it like this:
1|A
2|B
3|C
4|D

Arrays are treated like other kinds of maps.

People who use zero-based arrays try to justify their decision like this:
0|
|A
1|
|B
2|
|C
3|
|D

They do not, however, do this for functions or associative arrays. If you asked them to make a table for functions, they would put the arguments and results in the same row.

Name: Anonymous 2016-08-28 13:56

People are getting zerophobic ITT; 0 is a perfectly valid natural number on its own, being the first member of the set of natural numbers.

Name: Chad 2016-08-28 18:27

>>28
Maps aren't contiguous structures, arrays are. Your argument is invalid.

Name: Anonymous 2016-08-28 20:49

Benis in bagina

Name: Anonymous 2016-08-28 21:59

CheckEm

Name: /dubs/ 2016-08-28 22:04

dubs

Name: Anonymous 2016-08-29 16:15

>>7
Relative position to the pointer which points to the first element.

Name: Anonymous 2016-08-29 16:17

>>16
They put it their so you will become an SJW too.

Name: Anonymous 2016-08-29 16:54

>>26,27,30,34
Arrays have nothing to do with pointers. That's an implementation detail.

It would be like saying mathematical functions are about x86 machine code and the x86 opcodes for add are a fundamental part of the concept of addition.

Name: Anonymous 2016-08-29 17:20

>>36
That's an implementation detail.
No, not really. The C standard requires that the [] operator is usable as syntactical sugar for pointer arithmetic, and that arrays passed as arguments to functions become pointers to their first element.

Name: Anonymous 2016-08-30 5:48

>>37
>>36 kun is right, that is an implementation detail. There is no reason why it couldn't pass by value or copy the array and pass a pointer to it or whatever else it wanted to do.

Name: Anonymous 2016-08-31 0:57

>>38
Lots of existing C code (even fully-conforming code designed to demonstrate proper usage of the standard library functions) would be broken by an implementation that passes array arguments by value.

For example, something like

char str[100];
scanf("%s", str);


is quite common. However, if arrays were passed by value, it would be necessary to instead use

char str[100];
scanf("%s", &str);

Name: Anonymous 2016-08-31 1:13

>>39
Arrays have nothing to do with C, idiot.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List