My answer to your question for the United States is to direct you to the Directory Resources page of AT&T. Other United States telephone companies should have similar pages. :)
If this is not what you mean, you need to supply more information. Which telephone directory do you want to access? The C Programming Language does not provide features to access telephone directories natively. However, using its features, you could access telephone directories in your hosted environment. What operating system are you using? For that operating system, there may be third-party libraries available that support interfacing to the telephone directories available on that platform. If you want to create your own telephone directory, you could use the features of C to accomplish that. However, if your project team, development environment, and target environment are able to support C++, it would probably be a better choice.