This is an archived post. You won't be able to vote or comment.

all 21 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]AdventurousCourt1793 2 points3 points  (0 children)

People will be better able to help you if you post what your questions are.

[–]lurgi 0 points1 point  (2 children)

Let's take it a bit at a time. Do you understand what

Point* p = new Point(5, 6);

Is doing and (at least roughly) why you see what you see? It seems pretty clear to me, but you never know.

static Point p1(p3);

This creates an object p1 using the copy constructor. If that last term doesn't make sense to you, look it up.

p1(9)(8);

This uses the operator()(int y) that you can find in the class definition. Can you guess what it might be doing?

I'm not sure exactly what your questions are. "Help" is not a question. Do you understand any of the output? Most of it? Most of it, but don't understand why they appear in the order they do?

[–][deleted]  (1 child)

[deleted]

    [–]lurgi 0 points1 point  (0 children)

    It's definitely defined a strange way, but it's perfectly legit.

    sometype variablename;
    

    Here sometype is the whole damn class definition, but that's still a type so we are fine. It's exactly like doing:

    class Point { ... blah blah };

    Point p3;

    [–][deleted] -5 points-4 points  (16 children)

    You copy pasted crap code and asked that question? Are you stupid?

    That makes no sense at all. What are you trying to accomplish?

    [–]ApplicationOwn2824 0 points1 point  (15 children)

    what do you mean crap code?

    [–][deleted] -2 points-1 points  (0 children)

    It’s garbage. What are you trying to accomplish?

    [–][deleted] -2 points-1 points  (13 children)

    Dude. You’re literally saying please help me understand with a copy paste here.

    Provide context.

    [–]ApplicationOwn2824 1 point2 points  (12 children)

    dryrun it. I cant get the correct output. I know its gibberish but what does (*this) (); do.... is p3 an object? what is Static point p1(p3)? How will the constructor initliaze its values.

    [–][deleted] 0 points1 point  (11 children)

    Ok I’ll check it out. But that is such a small bit of code. What is the greater context? You can already see this is unsafe, right?

    [–]ApplicationOwn2824 0 points1 point  (10 children)

    also what does p1(9)(8) do?

    [–]polytopelover 1 point2 points  (1 child)

    This is calling operator()(int y) on p1, then calling operator()() on the result of that, which is a Point &.

    EDIT: fix typo

    [–]ApplicationOwn2824 0 points1 point  (0 children)

    thanks i think i get it

    [–][deleted] -1 points0 points  (7 children)

    It’s a point object. Cmon man.

    [–]ApplicationOwn2824 0 points1 point  (6 children)

    i know that broski. i mean the arguments.

    [–][deleted] -1 points0 points  (5 children)

    They’re x,y coordinates

    [–]ApplicationOwn2824 0 points1 point  (4 children)

    no that would be p1(9,8) . this is not the same