days of week program

Pages: 12
Wrong! It's not a data member, even remotely, grandpa. MYOFB


There are sound reasons for the array not being a data member. But why should I tell you - a nobody.

You're the one who wants to argue the point so the onus is on you to prove otherwise. So far your best shot is a spurious and nonsensical sizing claim which shows how silly you are.
There are sound reasons for the array not being a data member. But why should I tell you
Hmm. Let me think. I'll take "because they don't exist for $200, Alex."

You're the one who wants to argue the point so the onus is on you to prove otherwise. So far your best shot is a spurious and nonsensical sizing claim
It proves my point beyond any doubt, and you know it. Still, because I'm having so much fun watching you melt down and you dig yourself into a hole, here ya go:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <string>

using std::string;
using std::cout;

class Day
{
public:
    const std::string day_name[7]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
    int m_day_no;
};

class WithoutArray {
    int m_day_no;
};


int main()
{
    cout << "How is againtry wrong again? Let me count the ways.\n";
    
    cout << "#1: The size of the object is " << sizeof(Day)
	 << " with the array and " << sizeof(WithoutArray)
	 << " without it.\n";

    Day d1, d2;
    cout << "#2: There's a different array for each object\n";
    cout << "    d1.day_name is at " << &d1.day_name << '\n';
    cout << " and d2.day_name is at " << &d2.day_name << '\n';

    cout << "#3: The day_name is stored inside the Day object:\n";
    cout << "    d1 is at " << &d1 << '\n';
    cout << "    d1.day_name is at " << &d1.day_name << '\n';
    cout << "    d1.m_day_no is at " << &d1.m_day_no << '\n';

    cout << "#4: What fairy dust would cause day_name to NOT be in the object?\n";

    cout << "\nAnd more important, why is your ego so fragile that\n";
    cout << "you can't admit when you've made a simple mistake?\n";
}

How is againtry wrong again? Let me count the ways.
#1: The size of the object is 64 with the array and 4 without it.
#2: There's a different array for each object
    d1.day_name is at 0xffffcbd0
 and d2.day_name is at 0xffffcb90
#3: The day_name is stored inside the Day object:
    d1 is at 0xffffcbd0
    d1.day_name is at 0xffffcbd0
    d1.m_day_no is at 0xffffcc08
#4: What fairy dust would cause day_name to NOT be in the object?

And more important, why is your ego so fragile that
you can't admit when you've made a simple mistake?

All you’re doing grandpa is confirming that you don’t know what a data member is. Repeating you silly size nonsense is no advance.
You may wish to install @Helios's fantastic userscript here:
http://www.cplusplus.com/forum/lounge/270432/
To silence ... whatever againtry is writing.
It has been a pleasure not knowing what that idiot has been saying!
He's extra pissed at me because this isn't the first time I've pointed out a mistake in code that he posted. His ego is about as stable as air, so he goes crazy at the idea that he's made a mistake.

All you’re doing grandpa is confirming that you don’t know what a data member is.
Try again, againTry. You're making more and more absurd claims because you're so full of yourself that you can't admit a simple mistake. Seriously, I've never known anybody with an ego as fragile as yours. How hard is it to say "oops, right. My bad. Thanks. I'll edit my post."?

If you're so sure that I'm wrong then PROVE IT!
- what about the syntax makes day_name not a data member?
- Explain the output of my program. If it's not a data member then why is it located inside each object.

This is as much fun as a youtube video of some Karen melting down ... or a 2-year-old.
Interesting how the early discussion about code from someone else degenerates into ranting from an idiot because they have to defend writing crap code.

Being a self-taught (and still learning) programming hobbyist I make mistakes all the time. Even if the code I write is (relatively) bug-free, it is written rather sloppily. When others point out where I went wrong or could do better at first it hurts. Sometimes.

I like being shown correct/better ways. Doing so pushes me to improve what I understand and can do. I will hopefully keep learning programming for at least three days after I expire.
He's not going to answer straight up dyhayden.

All he'll do is say some BS like, "The way of the turtles proves you're wrong" as if he's correct but won't waste the words to explain why. He's someone who doesn't have the knowledge or skills to backup his fragile self-image.

The best thing we can do for someone like him is to ignore him and let him waste away in his own BS alone. When he realizes that there's no one around to actually care about his pathetic act, he might, just maybe, grow up.
Against-trying is not the only person with a ultra-fragile ego in these here parts of the interwebs. Another self-proclaimed "expert" is on a "bow to ME!" tirade in another thread.
He's someone who doesn't have the knowledge or skills to backup his fragile self-image.
The crazy think is that I have to disagree here. He often provides useful help. He just can't handle being wrong.
Topic archived. No new replies allowed.
Pages: 12