FSUTIL in turbo C Like DOS command

View previous topic View next topic Go down

FSUTIL in turbo C Like DOS command

Post  Admin on Sun Sep 07, 2008 12:55 am

#include<stdio.h>
#include<conio.h>
#include<dos.h>
main()
{
FILE *fp;
unsigned long check=0;
unsigned long size;
char fn[20];
clrscr();
printf("Enter file name: ");
scanf("%s",fn);
printf("Enter bytes");
scanf("%ld",&size);
fp=fopen(fn,"w");
while(size>check)
{
fputs(" ",fp);
check++;
}
printf("Compeleted");
getch();
}


AND IF YOU WANT THE LOOP WORKS FASTER THEN CAN TRY THIS:

#include<stdio.h>
#include<conio.h>
#include<dos.h>
main()
{
FILE *fp;
unsigned long check=0;
unsigned long size;
char fn[20];
unsigned long less;
clrscr();
printf("Enter file name: ");
scanf("%s",fn);
printf("Enter bytes");
scanf("%ld",&size);
less=size/48;
fp=fopen(fn,"w");
printf("%ld",less);
while(less>check)
{
fputs(" ",fp);
check++;
}
printf("Compeleted");
getch();
}
avatar
Admin
Admin

Posts : 256
Join date : 2008-06-06

View user profile http://debmedia.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum