Không anh, lỡ rồi giải cho xong rồi mai ngủ cả ngày
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define BUF_SIZE 64
int main(int argc, char **argv)
{
FILE *inFilePtr;
char fileName[BUF_SIZE];
char previous_char = ' ';
char current_char;
int is_quote_opening = 0;
puts("Enter file name for checking comments: ");
scanf("%s", &fileName);
int line = 1; //Mục đích là để xuất ra vị trí bắt đầu của comment trong trường hợp không đóng comment
if((inFilePtr = fopen(fileName, "r")) != NULL)
{
FILE *outFilePtr;
if((outFilePtr = fopen("result.txt", "w")) != NULL)
{
while((current_char = fgetc(inFilePtr)) != EOF)
{
if(current_char = '"')
{
fputc(current_char, outFilePtr);
while((current_char = fgetc(inFilePtr)) != '"')
{
fput(current_char, outFilePtr);
if(current_char == EOF)
{
puts("Error");
}
}
}
else if(current_char == '*' && previous_char = '/')
{
}
else
{
fputc(current_char, outFilePtr);
}
}
}
else
{
}
}
else
{
//Báo lỗi
}
}
Hướng giải hiện tại của em, em không biết biến tín hiệu có cần thiết không