#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
Char *get_str (char *src,char *DST)
{
Char *start=src;
static int count=0;
int i=0;
while (*start)
{
if (*start== '/' &&* (start+1) = = '/' &&count%2==0)
{
count++;
Break
}
else if (*start== ' * ' &&* (start+1) = = '/')
{
start+=2;
count++;
Break
}
* (dst++) =* (start++);
}
*dst=0;
return start;
}
Examples of comments mixed with code
void Fun2 ()
{
Char src[]= "//999*/666//999*/534643666//";
Char dst[10];
Char *arr=src;
while (*arr)
{
Arr=get_str (ARR,DST);
printf ("%s\n", DST);
}
}
Comment on the processing of multiple rows.
int main ()
{
FILE *fr=fopen ("In.txt", "RB");
FILE *fw=fopen ("OUT.txt", "WB");
ASSERT (Fr!=null);
ASSERT (Fw!=null);
Char start[50];
Char arr[100]= "//";
Char *str=null;
int count=0;
int n=0;
while (Fgets (START,100,FR)!=null)
{
Str=start;
while (*STR)
{
if (*str== '/' &&* (str+1) = = ' * ')
{
* (str+1) = '/';
Count=1;
}
if (*str== ' * ' &&* (str+1) = = '/' &&count==1)
{
*str=0;
strcat (Arr,start);
Fputs (ARR,FW);
count=0;
Break
}
str++;
}
n++;
if (count==1&&n==1)
{
Fputs (START,FW);
}
else if (count==1&&n!=1)
{
strcat (Arr,start);
Fputs (ARR,FW);
arr[2]=0;
}
}
Fclose (FR);
Fclose (FW);
return 0;
}
The project has not been merged well, for the most important 2 cases, can be dealt with separately, and the merger has an impact on each other
C + + annotations