This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<netinet/in.h> | |
#include<sys/socket.h> | |
#include<sys/types.h> | |
int main(void) | |
{ | |
char server_response[256]="you have reached the server"; | |
int server_socket; | |
server_socket=socket(AF_INET,SOCK_STREAM,0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h>//for using printf and scanf function | |
#include<stdlib.h>//for using atoi() function | |
#include<sys/types.h> | |
#include<sys/socket.h>//API conatins function like connect socket send rev | |
#include<netinet/in.h>//contains the structure sockaddr_in | |
#include<string.h>//for memset | |
#include<fcntl.h> | |
#include<netdb.h>//for using structure hostnet and for getting the host by name | |
#define MAX_BUFF 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
# :- ask the compiler to pre-process things written after it whether header file or macros before compiling the code | |
include : ask for inclusion of all the function in stdio header file | |
<> : stdio.h header file will be searched in the standard compiler include path | |
"" : stdio.h header file will be searched in the compiler include path as well as in current directory |
NewerOlder