no save
Assistance
Achat
News

Forum | programmation
ping en C
jfs, le lun. 02 mai 2005 à 11:30:33
Un tout grand merci à toi. Finalement j'y suis arrivé (du moins 1 partie). Voici le code :

#include <winsock.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <conio.h>
#define p 512
int main()
{
FILE *fichier;
FILE *fichier2;
char n;
char commande [p] ;

fichier = fopen ("fichier.txt","r");
fichier2 = fopen ("fichier2.txt", "w");

fscanf(fichier, "%s\n",&n);

int atoi(char *n);

strcpy(commande, "ping ");
strcat(commande, &n);

int ret = system (commande);


if (ret==1)
{
fprintf (fichier2, "%s\n", &n);
}
system ("pause");
return 0;


Maintenant c'est au moment ou je lui dis de lire les 2 adr qu'il merde :

#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <conio.h>
#define p 512
int main()
{
FILE *fichier;
FILE *fichier2;
char n, v;
char commande [p] ;

fichier = fopen ("fichier.txt","r");
fichier2 = fopen ("fichier2.txt", "w");

fscanf(fichier, "%s\n%s\n",&n,&v);

int atoi(char *n);
int atoi(char *v);


strcpy(commande, "ping ");
strcat(commande, &n);

int ret = system (commande);
if (ret==1)
{
fprintf (fichier2, "%s\n", &n);
}

strcpy(commande, "ping ");
strcat(commande, &v);

int ret = system (commande);
if (ret==1)
{
fprintf (fichier2, "%s\n", &v);
}
system ("pause");
return 0;

}

PrécédentLuffy =)
mai 05
Luffy =)
mai 05
Suivant
REPONSES
Luffy =)
mai 05
jfs
mai 05
Luffy =)
mai 05
jfs
mai 05
jfs
mai 05
Luffy =)
mai 05
jfs
mai 05
Luffy =)
mai 05
jfs
mai 05
Luffy =)
mai 05
Version Web
Réalisé par RedShift
no save