Write "printf" and exit the program, which is their one of good points.
main.cpp Mon Sep 28 19:16:03 2020 --- 35 :// From Head : 36 :// 37 :// int index : 38 :// int file_end : 39 :// FILE* fp : 40 :int found_level_001 (int index, int file_end, FILE *fp ) { 41 : char b_dummy[256]; 42 : int i, j ; 43 : FILE *tfp; 44 :// char keyword[2][5] = { "#", "/*" }; 45 : char* keyword[2] = { "---", "/*" }; 46 : 47 : printf("found_level_001.\r\n"); 48 : exit(-1); 49 : 50 : tfp = fp; 51 : for ( j=0; j<256; j++ ) { 52 : b_dummy[j] = '\0'; 53 : } 54 : 55 : for ( i =index; i<file_end; i++ ) { 56 : printf("i: %d loop starts.\r\n", i ); 57 : 58 : for ( j=254; j>=0; j-- ) { 59 : b_dummy[ j + 1 ] = b_dummy[ j ]; 60 : } 61 : 62 : fread ( dummy, 1, 1, fp); 63 : b_dummy[ 0 ] = dummy[0]; 64 : 65 : if ( a_compare( (char*)b_dummy, (char *)"---" ) == 1 ) { 66 : printf("We found |%s| as |%s| index %d i %d tfp %d fp %d\r\n", keyword[0], b_dummy, index, i, tfp, fp); 67 : exit( -1 ); 68 : } 69 : 70 : printf("i: %d loop ends.\r\n", i ); 71 : } 72 :} 73 : ---
willinglytranslate.blogspot.com