Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <vector>
- #include <ctime>
- #include <string>
- #include <sstream>
- using namespace std;
- int main(int argc, char argv[])
- {
- FILE *f;
- if (!(f = fopen("C://Users//ivolc//Downloads//card.raw", "r")))
- {
- perror("File read error\n");
- system("pause");
- }
- char ch = 0;
- char start, finish;
- char check[7] = {0xF,0xF,0xD,0x8,0xF,0xF,0xE};
- for (int i = 0; i < 7; ++i)
- {
- printf("%x", check[i]);
- }
- printf("\n");
- int i = 0;
- int photo = 0;
- while ((ch = fgetc(f)) != EOF)
- {
- if (ch == check[i])
- {
- ++i;
- }
- else
- {
- i = 0;
- }
- if (i == 7)
- {
- ++photo;
- printf("quantity of photo = %d",photo);
- }
- printf("%x ", ch);
- }
- fclose(f);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement