« first day (703 days earlier)      last day (4248 days later) » 

6:00 PM
@MooingDuck I've seen questions closed that were properly asked just because they were so basic and people just were answering "OMG USE GOOGLE"
 
@jornak They kind of have a point. SO is not Google.
 
@jornak that too
 
@Drise I don't know what you mean by typical.
 
@DeadMG The answer in question. Nice.
 
@JonathanSeng Life is brutal for people who don't think before they act, and make an attempt to (in this case) ask a question in a way that there's some hope of answering it reasonably.
 
6:00 PM
@DeadMG I guess SO isn't really that much into professionalism as EE is, lol.
 
But std::string isn't any less complicated than std::vector.
 
@R.MartinhoFernandes usual, normal, average, expected..
 
And I can point you to books that mention std::vector early.
And teachers too (look, @sbi is one; ask him).
 
@R.MartinhoFernandes Like me!
 
@R.MartinhoFernandes But hardly any C++ course covers anything out of the STL but std::string
 
6:01 PM
@Drise That's their incompetence, not how it should be.
 
@Drise The only thing we know about the OP's course is that it didn't cover pointers yet.
 
and they only use std::string just so they don't have to explain char*
@DeadMG I agree, but assuming std::vector was taught when they are just starting to cover arrays... "assuming just makes an ass out of u and me"
 
@Drise There's nothing wrong with that.
 
@Drise Well, I haven't seen the question, so I can't really speak to it.
 
Also, if juan's answer isn't appropriate, the question is either too localized, or not well-specified.
 
6:04 PM
@R.MartinhoFernandes More likely a duplicate
 
Did you notice the first part in the answer, the one that teaches how to pass arrays without using pointers nor vectors?
You're downvoting because he added more useful information than was requested.
 
@R.MartinhoFernandes he's using templates
If they haven't taught pointers, what makes you think they would have covered templates?
 
@Drise Because that's the answer.
 
i like the foobar icon. it didn't register a context menu item for folders but i found that in config. looks good
 
@R.MartinhoFernandes Bullshit. Is is not the answer.
 
6:06 PM
@Drise There's no other way to pass arrays without using pointers.
@Drise Then tell me a way to pass arrays without using pointers or templates.
 
@Drise calm down. It's the only way to do exactly what the OP said without using any pointers, but you're right that the OP probably misspoke/misunderstood.
 
@R.MartinhoFernandes I've done it before on an assignment exactly like this. It can be done.
 
@Drise Show me (i.e. post an answer and you'll get votes).
 
@Drise in "Inventory all[]", all is a pointer. It just doesn't look like it.
 
@MooingDuck Yes. But they don't tell you it's a pointer.
 
6:08 PM
sorry but i can't find ref to the question dicussed
what is it?
 
@Drise How does that change anything?
 
hi :) who does work with R2? :) I want to find logs with RDP connections, who does know where locate report/logs with RDP indeed?
 
@MooingDuck And that's what I said. And chances are that if pointers weren't taught and they have to use arrays, [] is the answer.
 
6:09 PM
> without using a pointer.
 
@Drise That's a pointer.
* is not a pointer, it's a star.
 
@JonathanSeng your answer is confusingly worded, but after some deliberation, I upvoted anyway.
 
@R.MartinhoFernandes Put array into a structure and pass by value... no?
 
well shit, then void addMovie(Inventory data[], double count); is a pointer too.
 
@MooingDuck Edit it to fix the wording.
 
6:10 PM
So can't use that either
 
wow
0
A: how to pass an array of struct without pointer? C++

DeadMGIf you wrap it in a value type, it can be passed directly, or referenced. This is neatly packaged for you in the Standard class std::array, but you can write your own struct or class if you want to.

 
@Drise that's a prototype/declaration, not a pointer.
 
/solved
 
I have to leave now.
 
@MooingDuck Still points to some location in memory
 
6:10 PM
@Drise data is indeed a pointer.
 
@DeadMG Again, misses the whole point of the question.
 
@Drise it's not an object, so it doesn't point to anything. It has no actual value
 
@DeadMG It's masked as an array, and that's how it's taught.
 
That question is so bad.
 
6:11 PM
And so, yes, the question shouldn't be here because people don't want to answer taht question.
 
there is no way to pass an array except by value or by pointer or by reference.
 
@CatPlusPlus Yes, because its a student. Put up a barbed wire fence to keep students out.
Anyway. I'm out.
 
so either juan's answer is right, or mine is.
 
@drise you should only vote on what you understand. lack of understanding does not mean something's wrong. it only means that you're not sufficiently competent in the area
 
Yes, because C++ courses are bad.
 
6:12 PM
Array -> Struct -> Pass by value. Done.
 
Also T[] is a pointer, and not using a star makes no difference.
 
@JonathanSeng No, the question is bad because it doesn't make any clear what the problem is.
 
@Cheersandhth.-Alf 1) I can vote how I want. 2) It doesn't answer the question.
 
Ell
hi all
 
Hi Ell
 
6:12 PM
If the solution were indeed [], then why is the answer posted in the question itself?
 
It's silly "do my homework for me" question first and foremost.
 
If it's not obvious, the downvote on the question is mine.
 
@Drise right, you can. you can also bare your ass at a restaurant. i'm telling you what you should, if you don't want to needlessly annoy those around you.
 
@JonathanSeng Not because s/he's a student, but because there really is no good answer to the question as it's being asked. In essence, we're forced to guess at what is and isn't covered in specific chapters of an unknown/unnamed text book. Without knowing what is or isn't allowed (or, equivalently, has/hasn't been covered), we're shooting in the dark.
 
It's a bad question because it mentions a constraint of only using some undisclosed chapters 1-8 of some undisclosed book.
 
6:14 PM
17 mins ago, by Mooing Duck
@JonathanSeng Having re-read the code in the question, I think the OP simply wanted to know how to call the addMovie function from main.
 
@JerryCoffin Agreed.
 
I think you guys are just being too pedantic. The OP obviously is new to the language and it's definitions and likely has no idea that Inventory data[] is a pointer.
 
@MooingDuck Exactly, that's why the question is bad.
 
No, it's a bad question.
 
@Drise Not really.
it's physically impossible for both my answer and juans to be incorrect
 
6:15 PM
Also stupid questions with stupid arbitrary restrictions are too localised.
 
@MooingDuck If that's indeed the intention (quite possible), the fact that everyone went out on to some entirely different thing makes it clear it's bad.
 
voted to close
 
@R.MartinhoFernandes I never claimed teh question wasn't bad. I might have even claimed the question was bad, but I don't recall.
 
Also the answers are bad, too. "The [] means that data is a pointer (it most likely points at the beginning of an array, but isn't required to), but its not quite the same as Inventory* data (which would also work)." Really?
 
And to @JonathanSeng's point. SO can be horrible to new programmers.
 
6:17 PM
@CatPlusPlus previous wording was " The [] means pointer (that likely begins an array -- but, we didn't really say that because we don't like pointers and [] is much better), but its not a Inventory* data (which would also work)."
 
Drise, Huntsville, AL
1.6k 9 19
 
I can be horrible to new programmers, too.
 
"I am an avid VB.NET fan" well there's your problem
 
@jornak Yes?
@jornak I don't see the connection you are making.
 
It's bitterness that develops when you're on SO for 4 years.
 
@Drise SO was never meant as a tutorial place, btw.
 
@MooingDuck I be trolling.
 
@R.MartinhoFernandes I know. But the point @JonathanSeng was trying to present is that SO can be horrible to new programmers. This is case in point.
 
@jornak noted
 
@MooingDuck I'm not one to attack ad hominem :P
 
6:19 PM
@Drise you're right that we should try harder to edit/fix questions, but there's so many duplicates and so many are ambiguous :<
 
@MooingDuck And the new wording still implies it's not exactly the same.
 
@R.MartinhoFernandes I was making it legible, not correct :(
 
The previous wording is even worse.
"we don't like pointers and [] is much better" the fuck
 
@Drise What exact case to which are you referring?
 
6:20 PM
@MooingDuck Thanks for the site though, going through each of those :P
 
Saying anything other than it's exactly the same will only lead to even more confusion.
 
@MooingDuck Maybe you should. I think we should make fun of them more often.
 
@DeadMG The last about 20 minutes of pedantry.
 
It's already confusing due to the language quirks in this area. Adding weird lies on top of it won't help.
 
What pedantry?
Correcting wrong answers is pedantry now?
 
6:21 PM
@Drise Pedantry? The fact that top-level [] and * are exactly equal in function parameters isn't pedantry, it's important correctness.
 
lol, pedantry.
 
@DeadMG the fact that the OP clearly said "no pointers" when the answer he's probably looking for is the [] which is a pointer.
 
Pedantry is arguing that member functions should not be called methods, because standard says member functions not methods.
 
allowing incorrect answers would only degrade the quality of answers on the site and defeat it's purpose.
 
"You can't use [] because technically speaking, it's actually a pointer"
 
6:23 PM
@DeadMG I think we all agree on that. Debate is on which answers are correct. The ones that answer exactly what was asked, or the ones that answer the intent of the question.
 
@DeadMG It's like those schools with no-fail policies.
 
Pedantry is twitching about "it's" in that sentence.
 
@CatPlusPlus Oh snap.
@CatPlusPlus It cannot be unseen. Damn you.
 
@MooingDuck Since OP has no idea what they're asking for, the latter.
 
Should be binned for its incorrectness
 
6:24 PM
...
 
@Drise There's nothing technically speaking about it. It's completely and entirely true and accurate.
 
Now your just doing it on purpose.
 
if you ban pointers, you can't have "pointers but with a different syntax".
 
@Drise You were the one defending silly arbitrary homework restrictions, IIRC.
 
the distinction between T* and T[] is meaningless and irrelevant.
in fact, you're the one being a pedant by insisting that [] and * should be treated as different when they are not.
 
6:25 PM
Saying anything other than the two are exactly the same is wrong and causes confusion. If you don't want to say the two are exactly the same, don't even mention it.
 
@CatPlusPlus I am. It's like answering "Oh hey, boost does this, here's a link!" when the question explicitly states "Boost is not an option".
 
template<typename T> using TotesNotAPtr = T*; void foo(TotesNotAPtr<int> lookitmanostars);
 
@Drise I don't believe anyone here responded with a pointer.
 
Because "Boost is not an option" is not relevant to larger audience.
 
@DeadMG If you'll pardon my being pedantic, that's not entirely true. It's true when defining a function parameter, but entirely false when (for one example) doing an extern declaration.
 
6:26 PM
@Drise You are free to interpret those answers as "there, you need to implement this". If you have trouble implementing that, you can post a question to that effect. You can't expect anyone to post an implementation of a Boost component on an answer to your question.
 
I can either answer with Boost or close as too localised.
 
@JerryCoffin Quite true. But I believe that we are all on the same page with regards to the specific context- which is entirely a function parameter.
that, of course, does not make it less correct to point out that in some other context, they are not identical.
 
@LucDanton lol, "totes"
 
Well, or just ignore the stupid question, because I have no interest in reimplementing Boost for silly OPs.
 
This entire chat is one page from its very beginning until now.
 
6:27 PM
@R.MartinhoFernandes I'm trying to be like, cool, maaaan.
 
You know what really irks me
People that use type *varname instead of type* varname
 
@jornak No. Are you sure I want to?
 
@jornak Steve Irkel?
 
I use both in the most inconsistent manner possible.
 
@jornak I use type * varname.
 
6:28 PM
@jornak Always a type* varname; kind of guy.
 
@CatPlusPlus Wow. Makes me sad.
 
@jornak In this case, you're the one clearly in the wrong.
 
type*varname
 
@EtiennedeMartel Worse :/
 
but it's part of the type
not the variable
 
6:29 PM
T* a, b
 
@CatPlusPlus Why did everything go dark all of a sudden?
 
What's type of b.
 
You guys always write code like you got a limited amount of whitespace.
 
It's not part of the variable but it's part of the declarator.
 
@CatPlusPlus Evenly distributed.
 
6:29 PM
@CatPlusPlus Dunno. AFAICS, that could be an expression.
 
@R.MartinhoFernandes Silly robot.
 
@EtiennedeMartel Golf, man, golf
 
@EtiennedeMartel It's not infinite therefore limited :P
 
Sometimes T* foo looks better sometimes T *foo looks better.
 
Ell
@CatPlusPlus lemme guess... T!
 
6:30 PM
Fuck T * foo though.
That's an expression.
 
@Ell Wrong. It's int.
int T = 0;
int a = 0;
int b = 0;
return T* a, b; // context-sensitivity FTW
 
@CatPlusPlus But which looks butter?
 
@R.MartinhoFernandes return 0, 0; What?
 
@R.MartinhoFernandes I'll cut you.
 
Ell
aww maan
 
6:31 PM
Mr<T>().pity_the_fool();
4
 
@Drise It's the comma operator.
 
@R.MartinhoFernandes ... which does...
 
@R.MartinhoFernandes Hey, I asked you a question
 
Seriously, I think there's a fair argument that writing code where it matters is the real problem. Only define one variable per declaration, and it becomes irrelevant (not that I actually follow that rule consistently, but I can see where it's probably a good idea).
 
@Drise Discards the result of the left operand, and returns the result of the right operand.
 
6:31 PM
Which does comma things.
 
@ManofOneWay Hmm, sorry, missed it in the deluge. Can you repeat ;)?
 
33 mins ago, by Man of One Way
@R.MartinhoFernandes have you read C++ Coding Standards (Herb Sutter and Andrei Alexandrescu) and/or Exceptional C++ Style (Herb Sutter)?
 
@R.MartinhoFernandes it executes both sides side, then results in the right side.
 
@Drise Evaluates and discards the left argument, then (is in, "sequence point") evaluates the right operand, which becomes the value of the expression. Unless you've overloaded operator,, in case most bets are off (and you definitely lose the sequence point).
 
@ManofOneWay Ah, only the latter.
 
6:32 PM
Robots don't read, they scan.
2
 
@R.MartinhoFernandes What did you think of it?
 
@JerryCoffin what? I thought the comma had no sequence point, unless it was overloaded
 
Ell
hmm i wonder what happened of SOPA
 
@Ell it was killed the day after the protest. They lost all their supporters.
 
and comes back even worse
 
Ell
6:33 PM
and now nothing is at risk?
 
@bamboon twice already
 
@ManofOneWay Quite interesting. Makes you think really hard about exception safety and how innocent things that look safe aren't.
 
@MooingDuck tabled
 
@MooingDuck The opposite -- it has a sequence point natively, but that's lost if you overload it.
 
Ell
wtf is a sequence point?
 
6:34 PM
@R.MartinhoFernandes I think I will buy them through my work
 
Guys!
what's THIS
 
It's a prvalue.
 
@R.MartinhoFernandes caps
@jornak ideone.com
 
@jornak I wonder if I should bin this?
 
@EtiennedeMartel Yep. Code dumps = ungood.
 
6:35 PM
It's actually working code :s
 
@Ell everything before a sequence point will always finish executing before anything after the sequence point.
 
@EtiennedeMartel Go ahead. I know you get a kick out of it.
@jornak With a non-standard main.
 
POWER ABUSE
(Yesss)
 
@R.MartinhoFernandes I binned only one message, and it was an animated GIF, IIRC.
 
I think that was me, too, haha.
 
6:36 PM
@Drise apperently I was misinformed. Good to know
 
Oh wait no, @Mysticial did that one
 
hey guise
I drew up a quickie manifesto thing
want to read?
 
On what? (and yes)
 
0
A: how to pass an array of struct without pointer? C++

Cheers and hth. - AlfYou ask, how to properly pass an array through functions with a struct without using a pointer. I think the key word phrase there is with a struct. You can do that as follows, passing by reference instead of passing a pointer: #include <assert.h> // assert #include <iostr...

 
6:38 PM
@DeadMG I might need some context on this.
 
well, I've been thinking about joining a local political party
 
@MooingDuck Tabled is often the same as killed, but without pissing off the sponsors (as much).
 
@EtiennedeMartel He's founding the Slightly Democractic Dictatorship of Puppyland.
3
 
the slightly democratic, lol
 
@R.MartinhoFernandes Oh, so he's aiming for a communist dictatorship?
 
6:39 PM
@JerryCoffin it's fine, they have no more sponsors :D
 
@DeadMG a bit too timid, perhaps? but otherwise a fine manifesto!
:)
 
Ell
@DeadMG Wow. Why do you want this stuff?
"The body of school pupils will also be given the direct right to vote on how to expend the school's budget, and which members of staff should have their contracts renewed" - what?
 
@Ell Because it's better for everybody.
 
@EtiennedeMartel The Puppy's republic of ... Puppies?
 
@Ell XBOX AND DAYZ
 
Ell
6:41 PM
what will stop a child from voting out a teacher that gives them lots of homework?
 
@Ell I'd hope that's just for higher grades
 
@Ell Homework is pointless and is typically busy work
 
@Ell Sorry, I think you missed something. Homework ceased to exist long ago.
 
Ell
@Drise It is not pointless at all
@DeadMG Explain :P
 
> The Commons will be replaced by a proportional representation system.
 
6:41 PM
"unstructured"
 
@EtiennedeMartel Vague enough to sound awesome.
 
i.e., each child chooses how to spend their school hours, and their home hours.
you can't force them to do anything- including homework
 
My hobby: Pressing Ctrl+Alt+Down while colleagues go to the bathroom and watch their faces when they get back to the computer
 
@R.MartinhoFernandes Yes. I wrote up with more detail somewhere else....
 
@DeadMG I think this is a lot bigger than you make it sound
 
6:42 PM
@jornak Appears to do nothing.
 
In Windows.
 
@MooingDuck You're right. It might make school effective and not a giant waste of money.
 
@jornak Just moves me to my other desktop
 
@jornak I'm on Windows and it still does nothing,.
 
6:43 PM
@DeadMG It's a feature of some graphic card drivers. It flips the screen upside down.
 
Meh
 
Oh, it must be the intel drivers, then
 
Get a new prank, come on
 
Yes, Intel usually has that.
 
@Drise it's new to me :/
 
6:44 PM
No, what's funny is rearrange the mouse/keyboard cables with someone else's computer. Or put your own mouse and keyboard on theirs.
 
or pop the keys and re-arrange
only two of them
 
As long as you don't move the nipples, I'm ok with that.
 
@jornak Most no one looks at the keys
 
Usually G and H
Surprisingly a lot of people do
 
@Drise most programmers don't
 
6:44 PM
Fuck
it's raining again
 
The nipples on my keyboard are on F and J, so it's fine.
 
Fucl
 
@Drise Oooh. Nice.
 
The girls here today in the office are chatty, christ
 
my phone has become so slow it's just silly. My fiance called, and it rang, and went to the answering machine, and then finally showed the "answer" button on the screen.
 
6:45 PM
I swear they're getting NO work done
 
And just about to go to class...
 
evening
 
@Drise BSOD screen saver is always fun.
 
@MooingDuck What phone?
 
@MooingDuck Wow, that's slow.
 
6:46 PM
The Motorola Droid 2 (GSM/UMTS version: Motorola Milestone 2; GSM/UMTS/CDMA version: Motorola Droid 2 Global) is the fifth phone in Verizon's Droid line. In the U.S., it is available exclusively on Verizon Wireless, and was released August 12, 2010 (pre-order sales of the device began August 11).{{cite web|author=ninagosaimas says: |url=http://www.product-reviews.net/2010/07/19/motorola-droid-2-release-date-and-first-verizon-pictures/ |title=Motorola Droid 2: Release D
 
@MooingDuck that redefines slow
 
@JerryCoffin I remember these old pranks that would make your screen "slippery" and your mouse would accelerate across the screen, and slip and slide
 
@MooingDuck Onebox to the rescue fail again!
 
Basically if it's downloading anything at all, everything else screeches to a halt :(
 
> can run Flash Player 10.1.
who needs that?
@JerryCoffin the worst thing is that this pic in the onebox is not actually on the wiki page
 
6:48 PM
@TonyTheLion yeah, I was wondering about that
 
Maybe we should post on Meta? Ugh
 
@TonyTheLion It is.
 
@R.MartinhoFernandes where?
 
Don't make a fool of yourself on meta.
 
@TonyTheLion Porns
 
6:49 PM
@TonyTheLion Expand the "Linux powered devices" thing at the bottom.
 
I won't
 
@R.MartinhoFernandes I can't find the URL of that pic in the HTML
@R.MartinhoFernandes ah, there it is!
 
@TonyTheLion Never count out the ability of OneBox to fail despite all odds.
 
@JerryCoffin Yea it's terrible
 
@TonyTheLion The onebox picks the image with the largest height in the source of the page, which means it doesn't have to be visible.
 
6:50 PM
@R.MartinhoFernandes the most hidden picture of them all. I wonder what the algorithm doing this actually does?!
 
hi
 
@R.MartinhoFernandes maybe the most matching image would be better.
 
It uses the height of the image file, not the apparent height, which also causes weird stuff sometimes (there was a case of an image that was displayed in a 32x32 box or something, but was gynormous and was being picked).
 
I had a question, can you read a file into an 2D array? But only certain lines?
 
@Link of course you can
 
6:52 PM
Sep 9 at 11:45, by daknøk
If you are new here, please read the newbie hints right away, and only post here afterwards. Thank you.
 
@TonyTheLion It's just crappy.
 
while (getline(stream, line)) { if (line == "blah") { /*put into 2D array*/ } }
@R.MartinhoFernandes yes that's obvious
 
@TonyTheLion Erm, and how would you describe that in code?
 
@R.MartinhoFernandes good point.
 
std::max_element(images.begin(), images.end(), std::best_match_comparator{})
 
6:53 PM
you're a robot, you should know. Don't you have reflection?
 
@TonyTheLion I'm not a vampire. Of course I have a reflection.
 
@TonyTheLion you got stream and line backwards
 
@MooingDuck I knew it. Damn.
 
Oh hey, it's the hippy dude looking at flowers and smoking in the rain
 
6:54 PM
Do vampires have reflections nowadays?
 
I know nothing about Vampires
 
@JerryCoffin Yes, they do not clearly state what in C++ they are allowed to use. However, jumping straight to templates and vectors does not help them.
 
@JonathanSeng This, again?
 
@JonathanSeng ever read accelerated c++?
 
@Drise I'm sorry. I'm not allowed to reply to someone's post after I left? Damn.
 
6:56 PM
@R.MartinhoFernandes Obviously non-trivial, but Google image search seems to at least produce somewhat useful results now and again.
 
Templates are a basic tool in C++.
2
It's not advanced, it's not complicated.
 
@JonathanSeng Just got beat into the ground and was very annoying. I was hoping we got past it.
 
@CatPlusPlus Yet it's one of the last concepts taught.
 
Because people who teach C++ typically have no idea what they're doing.
 
6:57 PM
unfortunately
 
@CatPlusPlus We've established this, yes.
 
we should all band together and revolutionize the way C++ is taught!
 
@JerryCoffin I suppose using the layout for clues would be a good start. The picture on the top right is often the best choice.
 
Found some weird code at work. Can somebody explain to me how the linker decided ptr was one variable? Or is this supposed to work, but is in poor taste?
Include file:
---------------
-- include guard --
char *ptr;

multiple C files include that include file.
Upon link ptr is a single variable shared by the C files that included the file.

Now I was taught that you *never* declare a variable in a header. You declare them in one module and if others need them you extern them in a header file.
 
Woah, woah, my screen.
 
6:57 PM
Fail
please remove that long ass message
 
@Chimera Tentative definitions?
 
@JonathanSeng It is probably premature to expect/ask them to write a template themselves, but vector is a whole different story -- it's the right answer, and trivial to use.
 
So Many newlines.
 
Don't tell me you don't know C either!
First Mysticial, now you!
:P
 
these C failures :P
 
6:58 PM
@TonyTheLion I don't understand how that even works...
it's clearly in poor taste, but should it work?
 
@Chimera Yes.
 
why wouldn't it work?
 
In C, not in C++.
 
@JerryCoffin Right up until the teacher fails them for not doing what was expected.
 
@R.MartinhoFernandes At least when you're dealing with Wiki, I believe their layout is consistent enough that this would probably be easy, at least in a large majority of cases. Looking at the larger picture (no pun intended) there should probably be an HTML header to specify exactly that.
 
6:59 PM
@Chimera in C, int i; int i; int i; is legal afaik
 
@Drise Okay, I shall say no more.
 

« first day (703 days earlier)      last day (4248 days later) »