No, I didn't want to refactor their code. What I did want to do is show what vector does internally.
Printable View
So this is a person that has just learned that there exists a thing such as std::vector, and you want to start off by showing off the internals?
This is not what a std::vector does internally.Code:int *foo = new int[newsize];
int pos = 0;
for (int j = 0; j < patt_len; j++, pos++) {
foo[pos] = pattern[j];
}
for (int j = 0; j < len; j++, pos++) {
foo[pos] = a[j];
}
cout << "foo is:\n";
for(i = 0; i < newsize; i++) {
cout << foo[i];
cout << "\t";
}
cout << endl;
delete [] a;
delete [] foo;
If a blind man was about to walk in front of a fast moving car, decent people would try to get him away from that car, or get the car to slow down. You, on the other hand, would probably play blind mans bluff.
I did bother to read the thread. That is the basis of my opinion about you, and my stating that was relevant to where the discussion had gone. You knowingly posted crappy code in a manner that is against site guidelines - which encouraged the OP to learn nothing and persist in bad technique. And then you have the arrogance to be self-righteous about it.
In any event, welcome to my ignore list. I have better things to do than read your rubbish. Consider yourself lucky I am not moderator here - if I was, you would be banned, or simply find you could no longer post.
Yes, I recognise that. That doesn't change the fact that the OP didn't want to think through the problem.
Your loss, Mr Grumpy.
I guess your attitude is behind you not being a moderator ;-) Try and be a bit more open and less abusive.
While rcgldr's code is bad, it does not alleviate you from blame.
I have read the thread, and my opinion is still that you are a liability.
To be fair, regardless of our opinion of SirPrattlepod, he/she has done nothing that breaks the rules. It's one thing to have an opinion, no matter how many people think it is rubbish, and one thing to break the rules. Moderators uphold rules. They do not regulate opinions.
Your attitude is hardly doing you any favours.
And I don't think grumpy's attitude has anything do with him/her being a moderator (or lack thereof).
As requested by the thread starter: thread closed.Quote:
Originally Posted by jeedi khan
jeedi khan, if you are still interested in getting help on this, I suggest that you start a new thread with your current code. Format your code well and post what exactly it is that you still need help with.