J
james.d.mclaughlin
I was having a look through the header files for a SAT-solver that I neededto work out how to use, and which for some reason seemed to be using a lotof the C versions of the headers (<stdlib.h> instead of <cstdlib> for instance) alongside C++ headers such as <algorithm>.
Which is how I encountered this:
#include <cstdio>
#include <string.h>
#include <stdio.h>
Does anyone know of any reason why someone would want to #include both stdio.h and cstdio in the same file? More importantly, are there any potential pitfalls to doing this? If there are, can I just fix them by commenting outthe line with stdio.h?
A slightly less important question as well - does anyone know of any reasonnot to change <string.h> to <cstring> in the above? I can easily go through the file putting std:: before function names and the like.
Many thanks,
James McLaughlin.
Which is how I encountered this:
#include <cstdio>
#include <string.h>
#include <stdio.h>
Does anyone know of any reason why someone would want to #include both stdio.h and cstdio in the same file? More importantly, are there any potential pitfalls to doing this? If there are, can I just fix them by commenting outthe line with stdio.h?
A slightly less important question as well - does anyone know of any reasonnot to change <string.h> to <cstring> in the above? I can easily go through the file putting std:: before function names and the like.
Many thanks,
James McLaughlin.