delete thread

Pages: 12
delete thread
Last edited on
1
2
3
string foo; 
foo += 'h';
foo += 'e';
why you do it?
answer my other questions
You seem a little demandy-pants there.

DonaldMike wrote:
how can i add chars togheter and insert this into string.

See my answer here:
http://www.cplusplus.com/forum/general/112149/#msg612280

DonaldMike wrote:
should i initiazle the string so buffer overflow wont happen?

No, you can reserve space if you know how big it's going to be (it makes it a little faster), but if you keep adding characters, it automatically resizes itself.

DonaldMike wrote:
what is the capability of this string?

Try: foo.capacity(), though this is the size until we need to resize, it's not a limit of how big the string can be.
http://www.cplusplus.com/reference/string/string/capacity/

DonaldMike wrote:
how much chars i can insert into is?

Try: foo.max_size(), it's probably limited by your RAM.
http://www.cplusplus.com/reference/string/string/max_size/

DonalMike wrote:
how to initialize astring?

With a constructor:
http://www.cplusplus.com/reference/string/string/string/

DonaldMike wrote:
string has dynamic size?

Yes

DonalMike wrote:
or the size will be the len of chars inserted at the initialization?

Dynamic

DonaldMike wrote:
how to combine those char togheres?

See: http://www.cplusplus.com/forum/general/112149/#msg612280

DonaldMike wrote:
should i use string or array of chars or char * ????

string

DonaldMike wrote:
what are pros and cons in every type??
char is a single character. If you don't need more, why not use this.
string is C++ best practices. It's easy to use, stable, dynamic sized,
char* is C. It's much more difficult to deal with. It's only useful for raw data blocks (though I would prefer unsigned char*) and for backwards compatibility with C when making headers.
If you're wondering why
string foo = 'a' + 'h'; doesn't work, here's why:

'a' + 'h' adds the two values. It doesn't concatinate them because at this point they are chars, not strings.

1
2
3
string a = 'a';
string h = 'h';
string foo = a + h;

This would work because a and h are now strings, and std::string has operator+ defined.
please stewbond delete all your posts in this thread
admin delete it
Last edited on
Deleting your posts from a forum after you get an answer is a jerk move.

The answers given help other people as well. I can't tell you how many times I've had a problem of mine answered by finding an old forum post through google.
Deleting your posts from a forum after you get an answer is a jerk move.

This can be the subject of an interesting debate: how the OP owns the thread but he does not own other people's replies within it.

And while trying to kill the thread that helped him suggests that the OP is in the wrong mindset, it remains his decision to make.

The answers given help other people as well. I can't tell you how many times I've had a problem of mine answered by finding an old forum post through google.

So what?

One could also say: "I can't tell you how many times I've had a problem of mine answered by starting my own thread."

It's not a crime, not caring about possible visitors from the future, whom you'd save 30 minutes worth of asking a question then waiting for a reply. It's your thread, that you made for yourself.
It's a breach in contract and doesn't work anyway.

By posting in a public setting you agree that your content is visible to the world - you've effectively given up your ability to control who sees your content.

You may remove or change your content but unfortunately for you the internet is forever and there is most likely an archived version of your original content somewhere.

Even if you don't agree with my first point, my second point still holds true. For instance Stewbond quoted just about every part of the original post, and I have saved the thread to my computer so if it is removed I still have a copy.
closed account (Dy7SLyTq)
why would you want to remove a post just out of curiousity?
Some people don't want their professors and classmates to know where their soaring intellect comes from.
L B:
Some people don't want their professors and classmates to know where their soaring intellect comes from.


Oh the laughter you just brought me. Why, he didn't even ask politely!
Garybeny wrote:
large scale of discussion here....
You created an account just to say that? It's not even that much discussion at all ;)
Catfish wrote:
And while trying to kill the thread that helped him suggests that the OP is in the wrong mindset, it remains his decision to make.


I agree. But he decided to be a jerk.

So what?

One could also say: "I can't tell you how many times I've had a problem of mine answered by starting my own thread."


I'm not saying he shouldn't start his own thread. I'm saying he shouldn't delete threads he has already started.

He gains nothing from it and it potentially harms others. Not only that but he has to actually go out of his way and make a point to do it. I struggle to see how it's defensible.

It's not a crime, not caring about possible visitors from the future


I'm not saying it's a crime. I'm saying it's a jerk move. ;P
I've seen a lot of forums where a mod or regular poster immediately quotes the OP to preserve it for posterity. Attempting to erase traces of your question really is a jerk move because you have people being led to the thread due to its title only to find that it's useless. Always pisses me off anyway.
@ stewbond: "Demandy-Pants"??? 8^D I'm definitely stealing that one.
Some people don't want their professors and classmates to know where their soaring intellect comes from.


No shame in admitting that I do that as well. But, I never thought about my prof cruising through these forums. Got me worried. Maybe I should, not delete but clean up my thread.
Last edited on
If you're not afraid to use your real name, you can edit any posts with your code to include in the comments that the code was written by you, that way they know you didn't plagiarize.
Last edited on
If you're not afraid to use your real name, you can edit any posts with your code do include in the comments that the code was written by you, that way they know you didn't plagiarize.


Okay, that's what i'll do.
No teacher worth a damn would discourage their student from independent study and/or seeking additional help. In fact tutoring is widely considered common practice.

Teachers only care if you are getting someone to do your work for you. Which wasn't the case in this thread (at least not as far as I can see).

OP could have had his name plastered all over this thread with his code showing and it would have been just fine.

I really cannot see any reason why he would want to delete the thread.


cnoeval wrote:
Always pisses me off anyway.


I wouldn't say it pisses me off, so much as it frustrates me. I put time into my responses with the hopes that my answers will help struggling developers with their problems.

To have some punk take my answer, then run away with it all secretly is more frustrating than anything else. It's extremely greedy and ungrateful. It almost makes me not want to bother posting responses.
If the forum supported spoiler tags, we could just quote the OP inside spoiler tags when we reply and people can expand them to see how the post was when we originally responded to it. Maybe we could ask twicker? I doubt spoiler tags are difficult to implement...
Pages: 12