Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define SIZE 2000
- int main()
- {
- FILE *filePtr;
- char arr[SIZE] = "";
- printf("Please enter the file you would like to open: \n");
- scanf("%s", arr);
- strcat(arr,".txt");
- filePtr = fopen(arr, "r");
- if(filePtr == NULL);
- {
- fprintf(stderr, "There was a problem opening the file \n");
- perror("Leaving now!!!\n");
- exit(-1);
- }
- while( fgets(arr, SIZE, stdin) )
- {
- printf("0x%s\n", arr);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement