How to make this code short?
#9

Quote:
Originally Posted by Deji
Посмотреть сообщение
That strcat thing is a bad suggestion. In order for strcat to work, it must count through every character in the string (every time, starting from 0, even when you know it's gonna be bigger than it was for the last strcat) until it finds the end and then start copying characters from the source to that end position, essentially expanding the string. It's also extra useless since all this data is constant and doesn't need variables at all.

However, since the compiler is apparently hating the long constant string length (which is a pretty annoying compiler trait) I guess I can't suggest any better alternative (std:tring's aren't an option sadly lol) but I'm sure there must be something if you want to aim for perfection (*hint*).
Actually using strcat for that - it IS faster than some other methods which using format which is pretty slow.
Reply


Messages In This Thread
How to make this code short? - by JaKe Elite - 03.10.2013, 10:17
Re: How to make this code short? - by Konstantinos - 03.10.2013, 10:19
Re: How to make this code short? - by Sublime - 03.10.2013, 10:21
Re: How to make this code short? - by JaKe Elite - 03.10.2013, 10:30
Re: How to make this code short? - by Konstantinos - 03.10.2013, 10:41
Re: How to make this code short? - by JaKe Elite - 03.10.2013, 10:54
Re: How to make this code short? - by xganyx - 03.10.2013, 11:10
Re: How to make this code short? - by Deji - 03.10.2013, 11:56
Re: How to make this code short? - by Konstantinos - 03.10.2013, 11:59
Re: How to make this code short? - by Deji - 03.10.2013, 13:29

Forum Jump:


Users browsing this thread: 5 Guest(s)