No, there isn't a single package. The C standard library is always installed, being a mandatory component to run any program, i.e. not only those written in C. The operating system wouldn't run without it. On the other hand, its associated headers are optional as they are only required to build programs.
There are multiple C++ standard libraries so the situation is more complex here.
In any case, res_query isn't part of the Solaris standard library (
libc) but of the resolver library (
libresolv).