Re: alternative way of addressing

From: Chris Hall (
Date: 01/28/02

Date: Sun, 27 Jan 2002 18:45:15 -0800 (PST)
From: Chris Hall <>
To: "J. Reilink" <>

John Doe wrote:
> Hi.
> I remember a while back on this list, there was a
discussion of alternative
> ways of addressing URLs (using hex code and binary,
I think). Can anyone
> give me a refresher course?
>Check here:
>"How to Obscure Any URL"

   Using above info, i have written a small program
 that will do conversion from decmial to IP and back

         IP 2 Decimal and Back agian
 Ever see a URL in the form of
  Basicly all that is the actual decimal value of
  This Program converts an IP ( dotted notation ) to
 the Decimal ( dotless notation) and Back agian.

       gcc -lm -o ip2d ip2d.c

 For more Conversion info:


#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int a,b,c,d;
char ip_address[20];
double num,num2,num3,num4;
int x,x2,x3,x4;
unsigned int numa;

int main(int argc, char *argv[])
       if(argc!=2) {
        printf("\nUsage: %s [-c] [-d]\n",argv[0]);
        printf("\t\t-c --- IP to Decimal\n");
        printf("\t\t-d --- Decimal to IP\n\n");
        if(argv[1][0]=='-' && argv[1][1] =='c') {
           printf("Enter IP to Convert: ");
              fgets(ip_address, sizeof(ip_address),

  /* Convert Dotted notation to dotless Notation */
          if(argv[1][0]=='-' && argv[1][1] =='d') {
             printf("Enter Number to Convert: ");
              fgets(ip_address, sizeof(ip_address),

  /* Covert Dotless notation to dotted Notation */


Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!

Relevant Pages

  • Re: Using epoll with real files
    ... I did not want to use a blocking write from the logging thread which lead me down this lane and I started playing with O_NONBLOCK and epoll. ... int main(int argc, char *argv) { ... Interestingly it does work reading from tty stdin, it also works when piping to stdin, but not when redirecting a file to stdin. ...
  • Re: stdin problem.
    ... I'm betting that you declared your variable as a char rather than an int, ... You should store it in an int. ... but if not stdin will be the terminal IE. keyboard. ... // Don't read stdin from the terminal just from a redirected file. ...
  • Re: help with select()
    ... > to monitor a socket and stdin. ... > int main{ ... > char buf; ... > addr_len = sizeof(struct sockaddr); ...
  • Re: Programmer wannabee question about sscanf
    ... int start, finish, values; ... char line; ... good habit to get into. ... fgets, stdin); ...
  • Compile error
    ... int main ... char h; ... struct hostent *x; ... Do you Yahoo!? ...