quote:Original post by AndyOxfeld
Are we talking about people who have never programmed before?
It appears that way.
quote:Original post by AndyOxfeld
Are we talking about people who have never programmed before?
quote:Original post by cpujeff122
I'm not sure, why would you?
quote:
The STDC works a lot faster if you just use the stack (like you can), but apparently I'm not allowed to do that for this test.
quote:
You know, your efficiency proofs are all very exciting an'' all, but you''re going to a lot of effort to prove nothing. You can''t prove that c-strings will be faster for my application, because you don''t know what it is, just like you can''t prove they will be faster for the OP, or you can''t prove they are faster for *any* application without actually measuring it. So, the question is, why are you engaging in wholesale premature optimisation? You''re going to a lot of effort to make yourself look a rank amateur.
quote:Original post by cpujeff122
You must have a slow computer. Running my code on a pentium 133 yields
STDC time: 2.200000 seconds
STL time: 4.13 seconds
And that's with -O2 and making the stdc one allocate memory.
quote:Original post by AndyOxfeld
You still haven''t proven that STL is faster[...]
quote:
[...]or easier[...]
#include <string>int main(){using std::string; string s1 = "Things "; string s2 = "and stuff"; // put two strings together: string s3 = s1 + s2;}
quote:
At least I backed my arguments up with code and data; you back yours up with theoretical ramblings and "what ifs".
quote:Original post by AndyOxfeld
You still haven't proven that STL is faster or easier for the OP's application. At least I backed my arguments up with code and data; you back yours up with theoretical ramblings and "what ifs".
- Andy Oxfeld
quote:
I thought your main argument for why to use C++ std::string is ease of use. Is that line you just pasted more or less complicated than char str[40]; ?
quote:
Are we talking about people who have never programmed before?