Thread: On using strcat

  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Rep Power

    Talking On using strcat

    Unforetunetly strcat does not work in my code because of this:
    The last 2 charecters are the input string. I have no idea why it does this.
    What's even more interesting is that it's very consistent about the first couple charecters IE it's always going to no matter when I run it or what I type in print:


    followed by my sting I intended to be there.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    Please post your code here. Smells like you've got uninitialized variables.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Rep Power
    It is not that strcat() does not work, but rather that your code does not work. We cannot help if we cannot see the code!

    Any use of strcat() is almost always ill-advised, and almost always avoidable. Most often snprintf() provides a simpler, safer, and more readable code.

    Why is strcat() bad? Well C string handling is terrible at best, but strcat() is especially problematic see this for why.

IMN logo majestic logo threadwatch logo seochat tools logo