what i am trying to do here is ask user for an ip address to ping then an ending ip address. so if they want to test a c class all they have to do is run the program and type in starting ip then ending ip.
Next step will be saving result to a file. But that will come later.
Can someone tell me how to get this working. Arrays are kicking my you know what. I must have read 10 tutorials on arrays. I get the basics, but after that I am lost.
it compiles with some errors. it does ask for starting and ending ip address. put it will not ping. i remember to use the strcat for the ping. i wrote a program to ping just one ip and it works great. thanks for the help with that one.
code:
.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
char startip[20];
char endip[20];
char pingtest[100] = "ping ";
int i;
printf("starting ip: ");
scanf("%s", &startip);
printf("ending ip: ");
scanf("%s", &endip);
for (i = &startip; i <= &endip; i++)
strcat(pingtest,i);
system(pingtest);
return 0;
}
.