Like Tree11Likes

Problem in concatenation of arrays

This is a discussion on Problem in concatenation of arrays within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Elysia You are making a fool of yourself again. The OP is a newbie. You are not. ...

  1. #61
    11DE784A SirPrattlepod's Avatar
    Join Date
    Aug 2013
    Posts
    485
    Quote Originally Posted by Elysia View Post
    You are making a fool of yourself again.
    The OP is a newbie. You are not. You are supposed to show how it is properly done instead of copy and pasting some code that you know is not good code. You are supposed to steer newbies to modern C++, not some mix-mash old C.
    No, I didn't want to refactor their code. What I did want to do is show what vector does internally.

  2. #62
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,013
    Quote Originally Posted by SirPrattlepod View Post
    No, I didn't want to refactor their code. What I did want to do is show what vector does internally.
    Then go back to C, please. You are a liability in C++.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #63
    11DE784A SirPrattlepod's Avatar
    Join Date
    Aug 2013
    Posts
    485
    Quote Originally Posted by Elysia View Post
    Then go back to C, please. You are a liability in C++.
    Excuse me. Read the thread. The conversation has moved onto discussing rcgldr's code. I have nothing to do with it.

  4. #64
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by SirPrattlepod View Post
    No, I didn't want to refactor their code. What I did want to do is show what vector does internally.
    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?

    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;
    This is not what a std::vector does internally.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  5. #65
    11DE784A SirPrattlepod's Avatar
    Join Date
    Aug 2013
    Posts
    485
    Quote Originally Posted by Neo1 View Post
    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?

    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;
    This is not what a std::vector does internally.
    *sigh*

    Read the thread! My silly code is not what's being talked about!

  6. #66
    Registered User
    Join Date
    Jun 2005
    Posts
    6,646
    Quote Originally Posted by SirPrattlepod View Post
    LOL. I simply used the OP's code.
    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.

    Quote Originally Posted by SirPrattlepod View Post
    Besides, if you bothered to read the thread you'd realise that we're no longer talking about my crappy code.
    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.

    Quote Originally Posted by Neo1 View Post
    Well to be fair, OP did post a version using std::vector a page or so back.
    Yes, I recognise that. That doesn't change the fact that the OP didn't want to think through the problem.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

  7. #67
    11DE784A SirPrattlepod's Avatar
    Join Date
    Aug 2013
    Posts
    485
    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.

  8. #68
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,013
    Quote Originally Posted by SirPrattlepod View Post
    Excuse me. Read the thread. The conversation has moved onto discussing rcgldr's code. I have nothing to do with it.
    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.

    Quote Originally Posted by grumpy View Post
    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.
    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.

    Quote Originally Posted by SirPrattlepod View Post
    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.
    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).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #69
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,271
    Quote Originally Posted by jeedi khan
    I think the discussion is getting non-academic more than fruitful..we should top here..stop it all please.
    As requested by the thread starter: thread closed.

    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.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Page 5 of 5 FirstFirst 12345
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. K&R problem !! String concatenation :(
    By karanmitra in forum C Programming
    Replies: 9
    Last Post: 08-18-2005, 06:20 AM
  2. printing arrays with concatenation
    By derek23 in forum C Programming
    Replies: 1
    Last Post: 07-17-2005, 04:02 AM
  3. concatenation
    By rose2626 in forum C++ Programming
    Replies: 10
    Last Post: 04-25-2003, 02:27 PM
  4. concatenation
    By F*SH in forum C++ Programming
    Replies: 34
    Last Post: 11-13-2002, 06:47 PM
  5. Concatenation in C++
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 12-05-2001, 01:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21