Túlio Cezar Posted October 24, 2011 Report Share Posted October 24, 2011 Estou com problema ao executar ping, na opção 1 , ele não deixa digitar o ip ou endereço.#include <stdio.h> #include <windows.h> int main () { char i; char p[30] = "Ping"; char ip[30]; char resultado[100]; do { printf("\t\t\t*------------------------*\n"); printf ("\t\t\t* |\\\\\\ Bem Vindo!!! ///| *\n"); printf("\t\t\t*------------------------*\n\n\n"); printf ("\t\t\tEscolha a Opcao a Seguir:\n\n\n"); printf ("\t\t\t(1)...Ping\n\n"); printf ("\t\t\t(2)...Netstat\n\n"); printf ("\t\t\t(3)...Rotas\n\n"); printf ("\t\t\t(4)...Banco de dados\n\n"); printf ("\t\t\t(5)...Sair\n\n\n\n"); scanf("%d", &i); } while ((i<1)||(i>5)); switch (i) { case 1: printf ("\t\t Digite um endereco ou Ip: "); scanf ("%[^\n]",ip); sprintf( resultado, "%s %s", p, ip); system (resultado); break; case 2: system ("\t\tnetstat -es\n"); break; case 3: system ("\t\troute print\n"); break; case 4: system ("\t\tmysql -u root -p\n"); break; case 5: system ("exit"); break; } system ("pause"); return 0; } Quote Link to comment Share on other sites More sharing options...
Question
Túlio Cezar
Estou com problema ao executar ping, na opção 1 , ele não deixa digitar o ip ou endereço.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.