July 31st, 2013, 01:20 PM
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.
July 31st, 2013, 01:21 PM
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
August 1st, 2013, 05:36 PM
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.