Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main(int argc , char *argv[])
- {
- FILE *file;
- char *string[100];
- int count = 0,n=0;
- // initialise file pointer to read
- file = fopen(argv[3],"r");
- // string to int
- n = atoi(argv[2]);
- // read character by character
- while(file , "%c" , string)!=EOF)
- {
- // break after n characters
- if(count == n)
- {
- break;
- }
- else
- {
- printf("%c" , line);
- }
- count++;
- }
- fclose(file);
- }
Add Comment
Please, Sign In to add comment