remove_all_pointer

#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include “aip_common.h” #include <string.h> #include <stdlib.h> #define ZERO (0) #define MAX_LINE_LENGTH (256) #define ADD_VALUE (0xF) #define FALSE (0) #define WRONG (0) #define SUCCESS (1) #define TRUE (1) #define STORESIZE (9) #define ENDOFSTRING (8) #define FOUR (4) #define ONE (1) #define SIXTEEN (16) /===================================================================================================================================/ /* Function Name: vd_s_initialize_array */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Initializes all elements of an array to ZERO. */ /* Arguments: U1* u1p_a_initialize_array : Pointer to the array to initialize / / size_t stp_a_initialize_size : Size of the array */ /* Return: None */ /===================================================================================================================================/ static void vd_s_initialize_array(U1* u1p_a_initialize_array, size_t stp_a_initialize_size) { size_t stp_t_initialize_array_i; for (stp_t_initialize_array_i = (U4)ZERO; stp_t_initialize_array_i < stp_a_initialize_size; stp_t_initialize_array_i++) { u1p_a_initialize_array[stp_t_initialize_array_i] = (U1)ZERO; /* Initialize each element to ZERO */ } } /===================================================================================================================================/ /* Function Name: vd_s_remove_trailing_newline */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Removes trailing newline character (\n) if present in buffer */ /* Arguments: U1* u1p_a_remove_buffer : Pointer to input buffer / / U4 u4_a_remove_length : Length of buffer */ /* Return: None */ /===================================================================================================================================/ static void vd_s_remove_trailing_newline(U1* u1p_a_remove_buffer, U4 u4_a_remove_length) { if ((u4_a_remove_length > (U4)ZERO) && (‘\n’ == u1p_a_remove_buffer[u4_a_remove_length - (U4)ONE])) { u1p_a_remove_buffer[u4_a_remove_length - (U4)ONE] = ‘\0’; /* Replace newline with null terminator */ } } /===================================================================================================================================/ /* Function Name: stp_s_open_input_file */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Opens input file “DA_510B_IMG_1.mhx” in binary read mode */ /* Arguments: None */ /* Return: FILE* : File pointer or NULL on failure */ /===================================================================================================================================/ static FILE* stp_s_open_input_file(void) { FILE* stp_t_open_fp; stp_t_open_fp = fopen(“DA_510B_IMG_1.mhx”, “rb”); return stp_t_open_fp; } /===================================================================================================================================/ /* Function Name: stp_s_create_output_file */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Creates/opens output file “WRITE_ADDRESS.TXT” in write mode */ /* Arguments: None */ /* Return: FILE* : File pointer or NULL on failure */ /===================================================================================================================================/ static FILE* stp_s_create_output_file(void) { FILE* stp_t_create_output_fp; stp_t_create_output_fp = fopen(“WRITE_ADDRESS.TXT”, “w”); return stp_t_create_output_fp; } /===================================================================================================================================/ /* Function Name: u4_s_process_s315_line */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Processes line starting with specified prefix. Extracts hex address, / / adds fixed offset, and stores modified address. */ /* Arguments: U1* u1p_a_process_line : Pointer to input line / / U1* u1p_a_process_new_hex_addr : Output buffer for modified address / / U1* u1p_a_search_str : Prefix string to search */ /* Return: U4 : TRUE if successful, FALSE otherwise */ /===================================================================================================================================/ static U4 u4_s_process_s315_line(U1* u1p_a_process_line, U1* u1p_a_process_new_hex_addr, U1* u1p_a_search_str) { U4 u4_t_process_result; U1* u1p_t_process_search_pos; U1* u1p_t_process_addr_start; size_t stp_t_len_after; U1 u1_tp_store_string[(U4)STORESIZE]; U4 u4_t_address_value; U4 u4_t_new_address; size_t stp_t_search_str_len; u4_t_process_result = (U4)FALSE; stp_t_search_str_len = strlen(u1p_a_search_str); /* Check for exact prefix match at start of line / if (0 == strncmp(u1p_a_process_line, u1p_a_search_str, stp_t_search_str_len)) { u1p_t_process_search_pos = u1p_a_process_line; u1p_t_process_addr_start = u1p_t_process_search_pos + stp_t_search_str_len; / Skip prefix / stp_t_len_after = strlen(u1p_t_process_addr_start); / Verify sufficient length for address extraction / if (stp_t_len_after >= (U4)ENDOFSTRING) { vd_s_initialize_array(u1_tp_store_string, STORESIZE); strncpy(u1_tp_store_string, u1p_t_process_addr_start, (U4)ENDOFSTRING); u1_tp_store_string[(U4)ENDOFSTRING] = ‘\0’; u4_t_address_value = strtoul(u1_tp_store_string, NULL, (U4)SIXTEEN); u4_t_new_address = u4_t_address_value + (U4)ADD_VALUE; / Apply offset */ snprintf(u1p_a_process_new_hex_addr, (U4)STORESIZE, “%08lX”, u4_t_new_address); u4_t_process_result = (U4)TRUE; } } return u4_t_process_result; } /===================================================================================================================================/ /* Function Name: vd_s_address_pair */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Writes modified address pair and default settings to output file */ /* Arguments: FILE* stp_a_write_address_fp : Output file pointer / / U1* u1p_a_write_address_hex_addr : Modified hexadecimal address */ /* Return: None */ /===================================================================================================================================/ static void vd_s_address_pair(FILE* stp_a_write_address_fp, const U1* u1p_a_write_address_hex_addr) { if (NULL != stp_a_write_address_fp) { fprintf(stp_a_write_address_fp, “0x40000000,0x%s\n”, u1p_a_write_address_hex_addr); fprintf(stp_a_write_address_fp, “0x43FFFFF0,0x43FFFFFF\n”); /* Write default settings */ } } /===================================================================================================================================/ /* Function Name: vd_s_write_default_address */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Writes predefined default address mappings to output file */ /* Arguments: FILE* stp_a_write_default_fp : Output file pointer */ /* Return: None */ /===================================================================================================================================/ static void vd_s_write_default_address(FILE* stp_a_write_default_fp) { if (NULL != stp_a_write_default_fp) { fprintf(stp_a_write_default_fp, “0x40000000,0x00000000\n”); fprintf(stp_a_write_default_fp, “0x43FFFFF0,0x43FFFFFF\n”); } } /===================================================================================================================================/ /* Function Name: u4_s_main_processing_task */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Processes input file: searches for prefix, extracts/modifies addresses, writes results */ /* Arguments: U1* u1p_a_search_string : Prefix string to search */ /* Return: U4 : SUCCESS if found and processed, WRONG otherwise */ /===================================================================================================================================/ static U4 u4_s_main_processing_task(U1* u1p_a_search_string) { U4 u4_t_main_processing_result; FILE* stp_t_input_fp; FILE* stp_t_output_fp; U1 u1_tp_line_buffer[(U4)MAX_LINE_LENGTH]; U4 u4_t_target_found; U1 u1_tp_new_hex_addr[(U4)STORESIZE]; size_t stp_t_main_processing_len; U4 u4_t_main_processing_line; U1* u1p_t_main_fgetsresult; u4_t_main_processing_result = (U4)WRONG; stp_t_input_fp = stp_s_open_input_file(); if (NULL != stp_t_input_fp) { stp_t_output_fp = stp_s_create_output_file(); if (NULL != stp_t_output_fp) { u4_t_target_found = (U4)FALSE; vd_s_initialize_array(u1_tp_new_hex_addr, STORESIZE); u1p_t_main_fgetsresult = fgets(u1_tp_line_buffer, (U4)MAX_LINE_LENGTH, stp_t_input_fp); while (NULL != u1p_t_main_fgetsresult) { u1p_t_main_fgetsresult = fgets(u1_tp_line_buffer, (U4)MAX_LINE_LENGTH, stp_t_input_fp); stp_t_main_processing_len = strlen(u1_tp_line_buffer); vd_s_remove_trailing_newline(u1_tp_line_buffer, stp_t_main_processing_len); u4_t_main_processing_line = u4_s_process_s315_line( u1_tp_line_buffer, u1_tp_new_hex_addr, u1p_a_search_string); if ((U4)TRUE == u4_t_main_processing_line) { vd_s_address_pair(stp_t_output_fp, u1_tp_new_hex_addr); u4_t_target_found = (U4)TRUE; u4_t_main_processing_result = (U4)SUCCESS; break; } } if ((U4)FALSE == u4_t_target_found) { vd_s_write_default_address(stp_t_output_fp); printf(“Line %s not found\n”, u1p_a_search_string); } fclose(stp_t_output_fp); } fclose(stp_t_input_fp); } return u4_t_main_processing_result; } /===================================================================================================================================/ /* Function Name: main */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Program entry point. Handles user input, file processing, and retry logic. / / Requires 4-character prefix input. */ /* Arguments: None */ /* Return: U4 : SUCCESS (0) on success, WRONG (1) on failure */ /===================================================================================================================================/ U4 main(void) { U4 u4_t_return_code; U4 u4_t_test_status; U1 u1_tp_search_string[(U4)MAX_LINE_LENGTH]; U1 u1_tp_choice[(U4)FOUR]; U4 u4_t_retry = (U4)TRUE; U1* u1p_t_main_fgetsresulta; U1* u1p_t_main_fgetsresultb; U4 u4_t_main_strlena; U4 u4_t_main_strlenb; u4_t_return_code = (U4)WRONG; while (u4_t_retry) { printf("Enter the search prefix string: "); u1p_t_main_fgetsresulta = fgets(u1_tp_search_string, (U4)MAX_LINE_LENGTH, stdin); if (NULL == u1p_t_main_fgetsresulta) { u1p_t_main_fgetsresulta = fgets(u1_tp_search_string, (U4)MAX_LINE_LENGTH, stdin); printf(“Error: Failed to read input. Exiting.\n”); system(“pause”); return (U4)WRONG; } vd_s_remove_trailing_newline(u1_tp_search_string, strlen(u1_tp_search_string)); /* Validate non-empty input / u4_t_main_strlenb = strlen(u1_tp_search_string); if ((U4)ZERO == u4_t_main_strlenb) { printf(“Error: Search prefix cannot be empty.\n”); continue; } / Validate 4-character length requirement / u4_t_main_strlenb = strlen(u1_tp_search_string); if ((U4)FOUR != u4_t_main_strlenb) { printf(“Error: Prefix must be exactly 4 characters.\n”); continue; } printf(“Processing with search string: %s\n”, u1_tp_search_string); u4_t_test_status = u4_s_main_processing_task(u1_tp_search_string); if ((U4)SUCCESS == u4_t_test_status) { printf(“SUCCESS! Processed: %s\n”, u1_tp_search_string); u4_t_return_code = (U4)ZERO; break; } else { printf(“FAILED: No matching line found.\n”); / Retry prompt */ printf("Retry? (y/n): "); u1p_t_main_fgetsresultb = fgets(u1_tp_choice, sizeof(u1_tp_choice), stdin); if (NULL == u1p_t_main_fgetsresultb) { u1p_t_main_fgetsresultb = fgets(u1_tp_choice, sizeof(u1_tp_choice), stdin); printf(“Error: Input read failed. Exiting.\n”); break; } vd_s_remove_trailing_newline(u1_tp_choice, strlen(u1_tp_choice)); if (u1_tp_choice[(U4)ZERO] != ‘y’ && u1_tp_choice[0] != ‘Y’) { u4_t_retry = (U4)FALSE; } } } system(“pause”); return u4_t_return_code; } 把初始化函数部分改成入参形式
最新发布
08-01
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include "aip_common.h" #include <string.h> #include <stdlib.h> #define ZERO (0) #define MAX_LINE_LENGTH (256) #define ADD_VALUE (0xF) #define FALSE (0) #define WRONG (0) #define SUCCESS (1) #define TRUE (1) #define STORESIZE (9) #define ENDOFSTRING (8) #define FOUR (4) #define ONE (1) #define SIXTEEN (16) /*===================================================================================================================================*/ /* Function Name: vd_s_initialize_array */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Initializes an array by setting all elements to ZERO. */ /* Arguments: U1* u1p_a_initialize_array : Pointer to the array to be initialized. */ /* size_t stp_a_initialize_size : Size of the array to initialize. */ /* Return: None */ /*===================================================================================================================================*/ static void vd_s_initialize_array(U1* u1p_a_initialize_array, size_t stp_a_initialize_size) { size_t stp_t_initialize_array_i; for (stp_t_initialize_array_i = (U4)ZERO; stp_t_initialize_array_i < stp_a_initialize_size; stp_t_initialize_array_i++) { u1p_a_initialize_array[stp_t_initialize_array_i] = (U1)ZERO; /* Fill each element with ZERO */ } } /*===================================================================================================================================*/ /* Function Name: vd_s_remove_trailing_newline */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Removes the trailing newline character (`\n`) in the given buffer, if present. */ /* Arguments: U1* u1p_a_remove_buffer : Pointer to the buffer to remove trailing newline character from. */ /* U4 u4_a_remove_length : Length of the buffer. */ /* Return: None */ /*===================================================================================================================================*/ static void vd_s_remove_trailing_newline(U1* u1p_a_remove_buffer, U4 u4_a_remove_length) { if ((u4_a_remove_length > (U4)ZERO) && ('\n' == u1p_a_remove_buffer[u4_a_remove_length - (U4)ONE])) { u1p_a_remove_buffer[u4_a_remove_length - (U4)ONE] = '\0'; /* Replace the trailing newline with a null character */ } } /*===================================================================================================================================*/ /* Function Name: stp_s_open_input_file */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Opens the input file "DA_510B_IMG_1.mhx" in binary mode for reading. */ /* Arguments: None */ /* Return: FILE* : Pointer to the opened input file. Returns NULL if opening fails. */ /*===================================================================================================================================*/ static FILE* stp_s_open_input_file(void) { FILE* stp_t_open_fp; stp_t_open_fp = fopen("DA_510B_IMG_1.mhx", "rb"); /* Open the input file in binary mode */ return stp_t_open_fp; } /*===================================================================================================================================*/ /* Function Name: stp_s_create_output_file */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Creates or opens the output file "WRITE_ADDRESS.TXT" in write mode for writing. */ /* Arguments: None */ /* Return: FILE* : Pointer to the opened output file. Returns NULL if creation fails. */ /*===================================================================================================================================*/ static FILE* stp_s_create_output_file(void) { FILE* stp_t_create_output_fp; stp_t_create_output_fp = fopen("WRITE_ADDRESS.TXT", "w"); /* Open the output file for writing */ return stp_t_create_output_fp; } /*===================================================================================================================================*/ /* Function Name: u4_s_process_s315_line */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Searches for a given prefix string in the line, extracts the hexadecimal address, */ /* modifies the address by adding a predefined value, and updates the output buffer. */ /* Arguments: U1* u1p_a_process_line : Pointer to the line being processed. */ /* U1* u1p_a_process_new_hex_addr : Pointer to the buffer to store processed hexadecimal address. */ /* U1* u1p_a_search_str : Pointer to the prefix string to search for. */ /* Return: U4 : TRUE if prefix is found and processed successfully, otherwise FALSE. */ /*===================================================================================================================================*/ static U4 u4_s_process_s315_line(U1* u1p_a_process_line, U1* u1p_a_process_new_hex_addr, U1* u1p_a_search_str) { U4 u4_t_process_result; U1* u1p_t_process_search_pos; U1* u1p_t_process_addr_start; size_t stp_t_len_after; U1 u1_tp_store_string[(U4)STORESIZE]; U4 u4_t_address_value; U4 u4_t_new_address; size_t stp_t_search_str_len; u4_t_process_result = (U4)FALSE; stp_t_search_str_len = strlen(u1p_a_search_str); // 检查行首是否匹配搜索字符串 if (0 == strncmp(u1p_a_process_line, u1p_a_search_str, stp_t_search_str_len)) { u1p_t_process_search_pos = u1p_a_process_line; // 匹配成功,位置就是行首 u1p_t_process_addr_start = u1p_t_process_search_pos + stp_t_search_str_len; // 跳过前缀 stp_t_len_after = strlen(u1p_t_process_addr_start); // 剩余长度 /* 确保剩余长度足够提取8个字符的地址 */ if (stp_t_len_after >= (U4)ENDOFSTRING) { vd_s_initialize_array(u1_tp_store_string, STORESIZE); strncpy(u1_tp_store_string, u1p_t_process_addr_start, (U4)ENDOFSTRING); u1_tp_store_string[(U4)ENDOFSTRING] = '\0'; u4_t_address_value = strtoul(u1_tp_store_string, NULL, (U4)SIXTEEN); u4_t_new_address = u4_t_address_value + (U4)ADD_VALUE; snprintf(u1p_a_process_new_hex_addr, (U4)STORESIZE, "%08lX", u4_t_new_address); u4_t_process_result = (U4)TRUE; } } return u4_t_process_result; } /*===================================================================================================================================*/ /* Function Name: write_address_pair */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Writes the processed hexadecimal address and additional default settings into the output file. */ /* Arguments: FILE* stp_a_write_address_fp : Pointer to the output file. */ /* U1* u1p_a_write_address_hex_addr : Pointer to the new hexadecimal address string. */ /* Return: None */ /*===================================================================================================================================*/ static void vd_s_address_pair(FILE* stp_a_write_address_fp, const U1* u1p_a_write_address_hex_addr) { if (NULL != stp_a_write_address_fp) { fprintf(stp_a_write_address_fp, "0x40000000,0x%s\n", u1p_a_write_address_hex_addr); fprintf(stp_a_write_address_fp, "0x43FFFFF0,0x43FFFFFF\n"); /* Default settings */ } } /*===================================================================================================================================*/ /* Function Name: write_default_address */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Writes predefined default address mappings into the output file. */ /* Arguments: FILE* stp_a_write_default_fp : Pointer to the output file. */ /* Return: None */ /*===================================================================================================================================*/ static void vd_s_write_default_address(FILE* stp_a_write_default_fp) { if (NULL != stp_a_write_default_fp) { fprintf(stp_a_write_default_fp, "0x40000000,0x00000000\n"); fprintf(stp_a_write_default_fp, "0x43FFFFF0,0x43FFFFFF\n"); } } /*===================================================================================================================================*/ /* Function Name: u4_s_main_processing_task */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Reads the input file, searches for the user-defined prefix in each line, */ /* extracts and modifies the hexadecimal addresses, and writes the results into the output file. */ /* Arguments: U1* u1p_a_search_string : Pointer to the search prefix string. */ /* Return: U4 : SUCCESS if processing completes successfully, otherwise WRONG. */ /*===================================================================================================================================*/ static U4 u4_s_main_processing_task(U1* u1p_a_search_string) { U4 u4_t_main_processing_result; FILE* stp_t_input_fp; FILE* stp_t_output_fp; U1 u1_tp_line_buffer[(U4)MAX_LINE_LENGTH]; U4 u4_t_target_found; U1 u1_tp_new_hex_addr[(U4)STORESIZE]; size_t stp_t_main_processing_len; U4 u4_t_main_processing_line; /* Initialize result as WRONG */ u4_t_main_processing_result = (U4)WRONG; stp_t_input_fp = stp_s_open_input_file(); /* Open the input file */ if (NULL != stp_t_input_fp) { stp_t_output_fp = stp_s_create_output_file(); /* Create the output file */ if (NULL != stp_t_output_fp) { u4_t_target_found = (U4)FALSE; /* Default: target not found */ vd_s_initialize_array(u1_tp_new_hex_addr, STORESIZE); /* Initialize buffer */ while (NULL != fgets(u1_tp_line_buffer, (U4)MAX_LINE_LENGTH, stp_t_input_fp)) { stp_t_main_processing_len = strlen(u1_tp_line_buffer); vd_s_remove_trailing_newline(u1_tp_line_buffer, stp_t_main_processing_len); /* Remove trailing newline */ u4_t_main_processing_line = u4_s_process_s315_line( u1_tp_line_buffer, u1_tp_new_hex_addr, u1p_a_search_string); if ((U4)TRUE == u4_t_main_processing_line) { vd_s_address_pair(stp_t_output_fp, u1_tp_new_hex_addr); u4_t_target_found = (U4)TRUE; /* Mark as found */ u4_t_main_processing_result = (U4)SUCCESS; break; } } if ((U4)FALSE == u4_t_target_found) { vd_s_write_default_address(stp_t_output_fp); /* Write default addresses */ printf("Line %s not found\n", u1p_a_search_string); } fclose(stp_t_output_fp); } fclose(stp_t_input_fp); } return u4_t_main_processing_result; } /*===================================================================================================================================*/ /* Function Name: main */ /* --------------------------------------------------------------------------------------------------------------------------------- */ /* Description: Entry point for the program. Prompts the user to input a search prefix, */ /* executes the processing task, and displays the results on the console. */ /* Allows the user to retry if the processing fails. */ /* Arguments: None */ /* Return: U4 : Returns SUCCESS if processing completes successfully; otherwise returns WRONG. */ /*===================================================================================================================================*/ U4 main(void) { U4 u4_t_return_code; /* Holds the return code indicating success or failure. */ U4 u4_t_test_status; /* Holds the status of the processing task. */ U1 u1_tp_search_string[(U4)MAX_LINE_LENGTH]; /* Buffer to store user input for the search prefix string. */ U1 u1_tp_choice[(U4)FOUR]; /* Buffer to store user's choice for retry. */ U4 u4_t_retry = (U4)TRUE; /* Flag indicating whether the user wants to retry or exit. */ u4_t_return_code = (U4)WRONG; /* Initialize the return code to WRONG (processing failure by default). */ while (u4_t_retry) /* Loop until the user decides not to retry. */ { printf("Enter the search prefix string: "); /* Prompt user to enter the search prefix string. */ if (NULL == fgets(u1_tp_search_string, (U4)MAX_LINE_LENGTH, stdin)) /* Read user input. */ { printf("Error: Failed to read input. Exiting.\n"); /* Display error message for invalid input. */ system("pause"); return (U4)WRONG; /* Exit with WRONG if input reading fails. */ } vd_s_remove_trailing_newline(u1_tp_search_string, strlen(u1_tp_search_string)); /* Remove trailing newline if present. */ /* Check if the user has entered an empty string. */ if ((U4)ZERO == strlen(u1_tp_search_string)) { printf("Error: Search prefix string cannot be empty.\n"); /* Display error message for empty input. */ continue; /* Restart loop and prompt user again. */ } printf("Processing with search string: %s\n", u1_tp_search_string); /* Display the current search string. */ if (strlen(u1_tp_search_string) != (U4)FOUR) { printf("Error: Search prefix string must be exactly 4 characters long.\n"); continue; } u4_t_test_status = u4_s_main_processing_task(u1_tp_search_string); /* Execute processing task with user input. */ /* Check processing status. */ if ((U4)SUCCESS == u4_t_test_status) { printf("SUCCESS! The search string: %s was processed successfully.\n", u1_tp_search_string); /* Display success message. */ u4_t_return_code = (U4)ZERO; /* Update return code to SUCCESS. */ break; /* Exit loop as processing succeeded. */ } else { printf("FAILED: No matching line was found for the provided search string.\n"); /* Display failure message. */ /* Ask user whether to retry. */ printf("Would you like to try again? (y/n): "); /* Prompt user for retry decision. */ if (NULL == fgets(u1_tp_choice, sizeof(u1_tp_choice), stdin)) /* Read user's decision. */ { printf("Error: Failed to read input. Exiting.\n"); /* Display error message for invalid input. */ break; /* Exit loop if input reading fails. */ } vd_s_remove_trailing_newline(u1_tp_choice, strlen(u1_tp_choice)); /* Remove trailing newline if present. */ /* Check user's decision. */ if (u1_tp_choice[(U4)ZERO] != 'y' && u1_tp_choice[0] != 'Y') /* User chooses not to retry. */ { u4_t_retry = (U4)FALSE; /* Update retry flag to FALSE. */ } } } system("pause"); /* Pause system to allow user to view the results. */ return u4_t_return_code; /* Return the result indicating success or failure. */ }帮我把里面中文注释变成英文,并且重新更新我改掉函数的英文注释
08-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值