Yamini
Yamini

Reputation: 1

networking header files in C++

I'm trying to convert a c program into c++ program . what is the equivalent header file for socket.h in c++ ?

Upvotes: 0

Views: 1630

Answers (2)

Jerry Coffin
Jerry Coffin

Reputation: 490808

There's no real need to change the headers at all. On the other hand, if you're just planning to use the existing code, I'd probably just add:

#ifdef __cplusplus
#extern "C" {
#endif

and

#ifdef __cplusplus
}
#endif

...to a header for your existing code, and leave it as C instead of re-compiling as C++.

If you're developing new code in C++, I'd consider using something like POCO, ACE, or Boost::ASIO instead of writing directly to the sockets API.

Upvotes: 0

SLaks
SLaks

Reputation: 888303

socket.h

Upvotes: 2

Related Questions