hello, pls look in to my program
and help me to modify this....
-
#include <stdio.h>
-
#include <string.h>
-
#include<stdlib.h>
-
-
main()
-
{
-
int x = 1,z;
-
long l,k;
-
char str[]=" 153.18.8.105";
-
char *str1;
-
char str2[16];
-
-
printf("String: %s\n", str);
-
str1 = strtok(str, ".");
-
strcpy(str2,str1);
-
-
while (1)
-
{
-
-
str1 = strtok(NULL, ".");
-
-
-
if (str1 == NULL)
-
{
-
-
exit(0);
-
}
-
strcat(str2,str1);
-
l=atol(str2);
-
printf("long integer is %ld \n",l);
-
}
here i tried some what......the thing is i dont knoe structure and union...
how to get the input string from user i.e the ip address using struct/union..pls guide me