Re: C++/C Counterparts.
C: C++ counterpart
arrays: std::vector, or use arrays the same as in C. There are many more containers in the STL.
printf : std::cout
malloc: new
free: delete
strcpy: = (assignment), or one of std::string's constructors.
strncpy: with std::string, you don't need to worry about string length (or the null terminator) anymore.
memcpy: don't know
memmove: don't know
You can still use null-terminated arrays of char like in C (a.k.a. C-strings) in C++ if you really wanted these functions (#include <cstring>).
qsort: std::sort, or a sort member function for the particular container you're using.
Lyle
|