Want to get first element in array

>want to get first element in array
>array[0]
>programmingfags will defend this
wtf i hate programming now

Other urls found in this thread:

warosu.org/g/thread/S55683927
cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
twitter.com/SFWRedditVideos

I remember the first time I saw this bait. But now I'm too old for this shit.

Did a lot of mistakes because this in the beginning, but you get used to it.

damn, I know this is bait, but it made me reply.
2/10

The more you use it the more you realise that starting at 1 in 'normal' counting systems is dumb

warosu.org/g/thread/S55683927

Holy fuck. I almost fell for this, I almost googled why [0] would be wrong.
Jesus fuck OP, you fucking faggot.

...

you're right it should be
if (array.length > 0) array[0]
else baka

he looks like pixy.

>not 0[array]

>Not just array
>Not indexing by array + n

>not array.First
stay pleb

>array[0]
>Not (car array)

>whats the first number
>0
>mathfags will defend this

There is a reason for this:
cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

>not using iterators

He has a name, you millennial fag.

Most people have names annon

Hey Tom! Been a while man, how are you?

Get element at offset 0.
What's the fucking problem here you retard?

Yeah, and his name is easiest name of all. And you would know who he is if you weren't born after 2000.

I love it when Sup Forums kiddies can't into math

I'm OK user

exactly, first = 1st, programmingfags will defend anything

>exactly, first = 1st, programmingfags will defend anything
see

nice try Big Maths shill, your propaganda won't work on me.

>want to get the digit in the one's place value
>have to do remainder division with 10 raised to 0

Trying this hard to let everyone know that you are not a child.
>You have to be older than 18 to use this site kiddo

ok

Is this m-more bait? Damnit, I replied.

That's a quirk of the C programming language. Every good programming language lets you choose the lower bounds of an array.

/thread

666 = 6*10^2 + 6*10^1 + 6*10^0

now try expressing this for bases >10, it gets complicated when you realise all bases can be called base 10(assuming you use the same numerals)

>want to get the last element in array
>array[array.length + 1]
wtf i hate dennis ritchie now

If you don't like it, just decrement the pointer before you start using it.

int *array = malloc(N * sizeof(int));
array--;
for (int i = 1; i

The ones digit is ALWAYS times 10^0 though, which was the point.

Dijkstra's paper is wrong because array index types (and most ranges in programming) aren't "natural numbers" but a finite set of values.

>To denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, four conventions are open to us
If these were months instead of natural numbers, you would have to choose convention c), which is February .. December. There is no month after December that you could write down in convention a).

>Consider now the subsequences starting at the smallest natural number: inclusion of the upper bound would then force the latter to be unnatural by the time the sequence has shrunk to the empty one.
That's only true when you start with 0. If you start with 1, the empty sequence has the range 1 .. 0.

Monday .. Friday is a range. Saturday .. Sunday is a range. Like the months, if you use an exclusive upper bound, there would be no way to specify a range of all days of the week. "Bignums" won't fix it. There isn't any 8th day of the week.

You see Dijkstra's mistake a lot in C. C programmers write int a[256] for an array indexed by 0 .. 255 but 256 isn't an 8-bit number. 0 .. 255 is a much nicer way to write it because you don't have to mention any values outside the index type.

>Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N.
Here he makes another mistake. Starting with subscript 1, it's 1 ≤ i ≤ N. Dijkstra picks 0 because he picked convention a), but convention a) is wrong.

I'm not arguing for "1 instead of 0" I'm arguing for being able to use ranges instead of a fixed lower bound. This is what Algol, Ada, PL/I, Pascal, Basic, Haskell, and most other languages not based on C do, and when you have an arbitrary lower bound (especially with enumerations), you will see that inclusive ranges make the most sense.

> not using array[::-1][0]

When did "wtf" come to mean both "what the fuck" and "why the fuck"? Why not "why tf" "ytf" y tf" or even "why the fuck"
I will always read it as "what the fuck"

Except he didn't mean "why the fuck", he meant "what the fuck".
Learn to reading comprehension you fucking retard.

>what the fuck i hate programming now
>why the fuck i hate programming now
the second one makes more sense

>look mom I posted it again xDDDD
Report, sage and hide.