« first day (1792 days earlier)      last day (3172 days later) » 

2:00 PM
15
Q: Is `*((*(&array + 1)) - 1)` safe to use to get the last element of an automatic array?

Cool GuySuppose I want to get the last element of an automatic array whose size is unknown. I know that I can make use of the sizeof operator to get the size of the array and get the last element accordingly. Is using *((*(&array + 1)) - 1) safe? Like: char array[SOME_SIZE] = { ... }; printf("Last ele...

wtf
 
It's not safe because nobody will be able to read it.
 
user1804599
OP's code is bad, OP should feel bad, and OP is a faggot.
 
user1804599
−1 for unformatted wall of text. — elyse just now
 
user1804599
> $100,000,000 goal
 
2:06 PM
And those reward tiers
 
> $0.00
> pledged of $100,000,000 goal
 
user1804599
@CatPlusPlus lol
 
> This project has a million risks and challenges associated with it. I will be the very first person to admit this. However should I get the funding needed I will quit my job and make this my full time responsibility.
 
Little did people know, the question was directed at Kickstarter users
 
This disturbs me: it means someone hired this guy to actually do something
 
2:07 PM
The answer was 'no'
 
@chmod711telkitty do you also have a pet cock?
 
People should stop wasting my oxygen
 
@CatPlusPlus lots of firsts there
 
user1804599
If I got 100 million bucks from a Kickstarter project I would also quit my job, but then abandon the project.
 
@orlp I had pet roosters
past tense
 
2:08 PM
@elyse donate it for ruby's development
 
user1804599
lol
 
@chmod711telkitty do you mean pet cocks?
 
user1804599
donating $100000000 to Matz.
 
nope emeralds are better
 
for example this man has a giant cock: roarlocal.com.au/wp-content/uploads/2013/11/…
 
2:10 PM
> the first space exploration telescope free of government censorship of live feeds and discoveries.
yup sounds like a madman indeed
 
and awesome product indeed
go fund it up
 
@chmod711telkitty beautiful big black cocks
2
 
omg no, NO.. STARSTORM HAS BEGUN
 
@chmod711telkitty The feathers look really good. What do you feed them?
 
2:13 PM
@MarcoA. but is it better than head n shoulders menthol
I love head n shoulders menthol because it freezes my balls and dick
 
> Poo used PK Starstorm!
 
I once 'lent' the soap of a roommate
since I was out
it felt like my balls were on fire :(
 
@edition chicken feed mostly, rice, bread, biscuits/cookies & sometimes meat.
 
not sure what was in it
 
@orlp Shaving foam sometimes makes a cold sensation instead.
 
2:16 PM
hey guys Im new to c++ but I have experience with c#. I know that in c# there is this object called List (Ive used it frequently). Is there a library in c++ that has this type of object. I am a student btw
 
std::vector
 
@Ethan library?
 
just #include <vector>
 
@MarcoA. aint that what you call them
 
it ain't
 
2:18 PM
Well, it's in the standard library.
 
@Ethan std::vector or std::deque
 
k ty
 
do not use std::list
 
I agree with the suggestions above by the way
 
it's not the same
 
user1804599
2:19 PM
I used binary trees and project skeletons. Am I a bioinformatics expert now?
 
@elyse no, you have become the tree
 
thanks guys I appreciate it
 
user1804599
Trees are graphs.
 
sure
 
yesterday, by Marco A.
 
user1804599
2:21 PM
Use A* to find the shortest path to a node in a binary search tree, then traverse that path to get the data you need.
 
the approach described in the paper is faster
 
@chmod711telkitty cool
 
any suggestion as to which is better (deque or vector). I simply need to add an unknown number of characters into it (AddFirst if possible)
 
@chmod711telkitty extraordinary claims require extraordinary evidence
 
2:29 PM
> http://timesofindia.indiatimes.com/
 
You can check on cppreference which one is better
 
So much redundancy
@Ethan std::vector
 
thanks again guys
 
If AddFirst is like push_front then you can't use std::vector for that
 
@ʎǝɹɟɟɟǝſ indiastimes.timesofindia.indiatimes.com
 
2:30 PM
But OTOH you can just push_back multiple times and std::reverse the vector
 
you could also use a stack if you only add at the beginning shrug
more intuitive than a deque that only adds at the beginning
I mean deques were created to support addition at both ends
 
@AlexM. no, that would be too obvious
 
sorry, but I don't know what a stack is. lol I am very very new to c++
 
It's just like Stack in C#
 
hmm Ive never used that. I'll check that out thanks
 
2:37 PM
you know that there's this thing called callstack
which is a stack
so it's not really hard to figure out what a stack ADT is like
I'm sure you've seen a callstack or two when your program threw an exception
 
@AlexM. Not really
Stacks limit both inserting and removing
 
Yeah.
Also deque is horrific in all implementations do not use.
 
No that's only MSVC
As usual
 
Chandler during his talk said deque wasn't too great on the others either.
 
MSVC has also horrible <iostream> implementation
 
2:42 PM
Plus stack and queue in C++ are adaptors not actual containers
 
yes it seems stack uses deque by default
 
If you always append then always append and read the vector backwards
 
@CatPlusPlus in what way?
 
There, you've got inserting to the front
@AlexM. Uh
Do I have to tell you how stack works
 
@AlexM. You can only pop, peek, and push to the top of the stack....?
There's no erase insert etc...
 
2:44 PM
Adding always to one side of container doesn't mean that you always want to take the same element out
 
Also
does std::stackdo push_back and pop_back by default?
Or push_front pop_front by default?
 
@ThePhD I think so
 
It adapts deque, so it doesn't matter
 
@ThePhD I thought there was something aside from that
 
Probably push_back to be better with vectors
 
2:45 PM
And queue demands push_front and pop_back, I think.
 
anyway now I notice that you can't iterate on a stack either
why would you not allow getting an iterator over it
 
It's usually not a very useful thing to do when you need a stack or a queue
 
> back()
front()
push_back()
pop_front()
 
user1804599
Invoke clang-format from an action passed to unsafePerformIO.
 
That's queue.
> back()
push_back()
pop_back()
That's stack
So stack is vector-compatible, queue isn't.
 
2:47 PM
queue would be fairly terrible on a vector
 
user1804599
Implement a queue using two vectors.
 
Too difficult for C++
 
Why 2?
 
user1804599
One to enqueue to, one to dequeue from.
 
Oh.
Ownership might be difficult.
 
user1804599
2:48 PM
When the one to dequeue from is empty, move the one to enqueue to into it in reverse, and then empty the one to enqueue to.
 
Ownership is the same
 
I don't quite get it, but...
Alright!
 
also there's orlp's devector
 
What's devector ?
 
2:49 PM
a north korean devector
 
Oh.
Double-ended vector.
 
Only 785 SLOC with comments, nice
 
user1804599
 
Is that the Boost license?
 
@набиячлевэлиь it's not finished yet
 
2:52 PM
Wait, there's no ALL-CAPS text yet.
BSD?
 
I can tell you
exception handling in containers is a bitch
 
Oh, aha. You're right here. What license is it?
 
It's 3-clause BSD without the disclaimer
 
@ThePhD zlib
 
Or something very similar
 
2:53 PM
Oooh.
 
@ThePhD dont-claim-you-made-it-and-leave-me-alone
 
> What would the perfect planet be like? io9.com/what-would-the-perfect-planet-look-like-1503442354
this is interesting
usually I think about planets out there being less habitable than earth, but not more habitable
 
I'm still unaware of anything similar to devector
despite the idea being so simple
 
@AlexM. the one that doesn't have PHP programmers on it
 
user1804599
Because most people don't care and their programs can do fine with std::list.
 
user1804599
2:56 PM
スタック・オーバーフロー is racist because it assumes Asians can't speak English.
 
localized SO sites aren't a problem thanks to the networking effect
 
@elyse then why is there no elyse.stackoverflow.com?
 
user1804599
Because Elyse isn't a language.
 
foreigners speaking english will ask on english SO
 
@elyse no, but it's well known you can't speak english
 
2:58 PM
@milleniumbug a.k.a. our-localized-site-is-too-small-so-Im-gonna-use-main-effect?
 
hurr
 
user1804599
You must be confusing me with @thecoshman.
 
@набиячлевэлиь even if it's big enough, it doesn't matter
 
Or @TonyTheLion after talking with grills
 
they'll still ask on main
 
2:59 PM
right
 
user1804599
haha
 

« first day (1792 days earlier)      last day (3172 days later) »