There is a problem, a text is given at the entrance (program code with comments like /*коммент*/ ). It is necessary to cut out comments from this text and return. Here is my example, but it does not work. How can I fix it?: D
#define L 300 int main() { char s1[L]; // Входной текст char s2[L]; // Выходной текст int fl = 0; printf("Введите исходный текст (макс %d симв.): \n", L); gets(s1); printf("Начальный текст: \n"); puts(s1); strcpy(s2,""); int i = 0; while(i<strlen(s1)) { if (s1[i] == '/' && s1[i+1] == '*') fl = 1; if (s1[i] == '*' && s1[i+1] == '/') fl = 0; if (fl == 0) { int j = 0; strcat(s2, &s1[j]); j++; } i++; } printf("Выходной текст: \n"); puts(s2); system("pause"); }
/**/or add/**/? - E1mirint/**/x;merged intointx;. - VladD