Thread: concatenation

  1. #31
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    lol all you want, then when you're finished... go program in C. C is not C++, get over it.

    That paragraph of supposed "facts" is nothing but opinion and poor assumptions based on insufficient data. The absolute LAST thing I would do is get into a freaking language war; its apples and oranges. Like I said, if you don't like it, go program in C.

  2. #32
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I can write a "permutation program" in less than five minutes using C++.

    These functions exist in the standard library:

    prev_permutation
    next_permutation



    I also dare say that they're pretty fast.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #33
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    Maybe if you want to use strcat() you can do this:
    if you have x, y, w as strings, and you want to put x and y in w.
    Code:
    strcat(w,y);
    strcat(w,x);
    or you can change the order but I think it will do the jub

  4. #34
    C > C++ duders ggs's Avatar
    Join Date
    Aug 2001
    Posts
    435
    sangdrax, you sure those are iso standard? Well, guess that doesn't matter. Not bad for c++.

    Yeah, eibro, i'll go program in C. I wouldn't post this, except that you say i'm putting those forth as "Facts". Never said that. Put that forward as my opinion, and at this moment in time I stand by it.
    .sect signature

  5. #35
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by ggs
    sangdrax, you sure those are iso standard? Well, guess that doesn't matter. Not bad for c++.
    Yes. This is a quote from the ISO/IEC standard specification:

    25.3.9 Permutation generators
    Code:
    template<class BidirectionalIterator>
    bool next_permutation(BidirectionalIterator first,
    BidirectionalIterator last);
    template<class BidirectionalIterator, class Compare>
    bool next_permutation(BidirectionalIterator first,
    BidirectionalIterator last, Compare comp);
    1 Effects:
    [...]
    Code:
    template<class BidirectionalIterator>
    bool prev_permutation(BidirectionalIterator first,
    BidirectionalIterator last);
    template<class BidirectionalIterator, class Compare>
    bool prev_permutation(BidirectionalIterator first,
    BidirectionalIterator last, Compare comp);
    3 Effects:
    [...]
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String Concatenation Using Pointers No strcat()
    By oviang in forum C Programming
    Replies: 4
    Last Post: 12-07-2007, 10:31 AM
  2. printing arrays with concatenation
    By derek23 in forum C Programming
    Replies: 1
    Last Post: 07-17-2005, 03:02 AM
  3. concatenation
    By rose2626 in forum C++ Programming
    Replies: 10
    Last Post: 04-25-2003, 01:27 PM
  4. queue concatenation
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 04-02-2002, 06:35 AM
  5. integer concatenation with string again...
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-11-2002, 06:36 PM