Академический Документы
Профессиональный Документы
Культура Документы
h>
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>
#define BACKSPACE 8
#define ENTER 13
#define BLANK 32
#define SIZE 32
#define BEEP putch(7)
#define SPACE 32
#define IGNORE BEEP;continue
#define MAX 36
void Backspace (void);
char * GetIP (void);
int main (void)
{
//After third period there MUST be one more octet After it eg 255.
255.255.HERE
if(buffer[indexPeriod+1]!=NULL)
{
buffer[pos]=NULL;
//Make While Loop Stop
pos=99;
break;
}
else
{
IGNORE; //eg 192.168.1.NULL
}
case '.' :
if(pos==0)//cannot start ip with a period
{
IGNORE;
}
if(buffer[pos-1]=='.')//ip address cant haf double periods
{
IGNORE;
}
if(period==3) // ip address max periods is 3
{
IGNORE;
}
buffer[pos]=putch(ch);
period++;