![]() |
![]() |
#1 |
![]() Join Date: May 2010
Location: ITALY
Posts: 31
![]() |
![]() Code:
include <iostream.h> #include <sys/socket.h> #include <netdb.h> #include <sys/types.h> #include <unistd.h> void usage(char *argv); int main(int argc, char *argv[]) { /* GETOPT - Variable: char * optarg - This variable is set by getopt to point at the value of the option argument, for those options that accept arguments. - Function: int getopt (int argc, char **argv, const char *options) - The options argument is a string that specifies the option characters that are valid for this program. An option character in this string can be followed by a colon (`:') to indicate that it takes a required argument. If an option character is followed by two colons (`::'), its argument is optional; this is a GNU extension. */ char *ircServerName = NULL; char *ircNickName = NULL; char *ircPortNumber = NULL; char *ircChannelName = NULL; /* get all the parameters */ int startingCommandLineOptions; while((startingCommandLineOptions = getopt(argc, argv, "n:c:s:p:")) != EOF) { switch(startingCommandLineOptions) { case 'n': ircNickName = strdup(optarg); break; case 'p': ircPortNumber = strdup(optarg); break; case 's': ircServerName = strdup(optarg); break; case 'c': ircChannelName = strdup(optarg); /*if(*ircChannelName != '#' && *ircChannelName != '&') { printf("\nError: The channel name should start with a #\n"); exit(1); }*/ break; default: usage(argv[0]); break; } } /* check if we filled all the required arguments */ if(!ircServerName) { printf("Error: You need to specify a server.\n"); exit(1); } if(!ircNickName) { printf("Error: You need to specify a nickname.\n"); exit(1); } if(!ircPortNumber) { printf("Error: You need to specify a port number.\n"); exit(1); } if(!ircChannelName) { printf("Error: You need to specify a channel name.\n"); exit(1); } /* INFORMATION ABOUT GETADDRINFO() FUNCTION - The getaddrinfo() function is defined for protocol-independent nodename-to-
__________________
Allah Pak Ki Yaad Rakho Hamesha
![]() |
![]() |
![]() |
![]() |
#2 |
naeem kh
![]() Join Date: Jul 2010
Location: pakistan
Posts: 1,265
![]() ![]() ![]() ![]() ![]() |
![]()
very nice thanks for sharing
|
![]() |
![]() |
![]() |
#3 |
![]() Join Date: Sep 2010
Posts: 21
![]() |
![]()
Its hard twtwtw
|
![]() |
![]() |
![]() |
#4 |
![]() Join Date: Mar 2011
Posts: 1
![]() |
![]()
nice
|
![]() |
![]() |
![]() |
#5 |
![]() Join Date: Apr 2011
Posts: 1
![]() |
![]()
i am muhabbat from pca pak cyber army
|
![]() |
![]() |
![]() |
#6 |
Join Date: Jun 2011
Location: C:\Windows\System32
Posts: 601
![]() ![]() |
![]()
Nice, thanks for sharing
__________________
|
![]() |
![]() |
![]() |
#7 |
Join Date: Aug 2011
Location: ♥-♥-♥In Ur Heart ♥-♥-♥
Posts: 86
![]() |
![]()
can u explain yeh kis chez ky lia hai?
|
![]() |
![]() |
![]() |
#8 |
![]() Join Date: Jul 2012
Posts: 1
![]() |
![]()
Assalam O alaikum!
i need a program which can count the repeated number entered during execution in an array in c++ can any one????? |
![]() |
![]() |
![]() |
#9 |
![]() Join Date: Oct 2013
Posts: 30
![]() |
![]()
i know..
|
![]() |
![]() |
![]() |
#10 |
![]() Join Date: Oct 2013
Posts: 30
![]() |
![]()
i know.
|
![]() |
![]() |
![]() |
Bookmarks |
Tags |
code, worm |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
1000 visual basic source code! | brighteye | General Discussion | 5 | 10-31-2009 03:30 AM |
Windows XP mein WORM/Hacker ka door band karen | Qamar | Software(with Roman review) | 11 | 09-20-2009 12:29 AM |