I'm afraid it's too generalized. You should try to cut your code down to the smallest, compilable example that demonstrates the problem. This process, while probably painful, might reveal the problem.
It seems likely that the function you're calling is doing something that you don't realize...
...(how often the function is called) and the project requirements are some of the things that will determine whether or not that memset will be worthwhile or not.
Don't get me wrong, intialization is a *good* thing, generally. I just wanted to point out that it is not *always* best practice.
It's certainly debatable if an initialization constitutes "good programming practice" in all instances, particularly if that initialization constitutes a hit on runtime performance.
The closest you can come is to use multiple case statements and take advantage of "fall-through":
case 'T': case 'V': case 'K':
/* do something */
break;
If you don't plan on modifying the contents of proddir, you can do what rwb suggested and change proddir to a pointer and...
Incidentally, if %n weren't specified by the C standard (it is, as manvid points out), we don't know how printf will behave when encountering it. The implementation might provide a meaning for it or it might not. Your program might conceivably crash if you pass printf an unrecognized conversion...
You're right in that you can use vectorname.size() inside the conditional, rather than assign it to a variable and then test the variable in the condition.
I believe in most of the examples the author creates a typedef and uses that typedef in two or more cases throughout the program, so that...
I'll admit that my earlier comments did constitute a "casual review" and I retract my statements comparing rot13 to butthead's algorithm. I glanced over the code, without taking note that a key was being used and thought that it amounted to simple letter substitution.
My apologies to...
atoll isn't part of C89, but is part of C99 (the new C standard). However, most C compilers are C89 compilers and therefore may not provide atoll. See the compiler documentation and see the linker options mentioned in the diagnostic.
If your compiler doesn't provide it, there may be atoll...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.