DEV/DEV1.1/TP12/numerotation.c

20 lines
302 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
FILE *f;
f=fopen(argv[1],"r");
char * buffer = NULL;
size_t x=0;
int y=0;
while((getline(&buffer,&x,f))!=-1)
{
printf("%06d ",y);
printf("%s",buffer);
y++;
}
fclose(f);
printf("\n");
}