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.
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 unsignedchar*) and for backwards compatibility with C when making headers.
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.
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.
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.
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.
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...