Hello,
i have a string:
And I want it to look like this:
I was trying to do in that way, 'line' is the string I am reading from.
Code:
char format[250];
char pom[10];
bool exist = false;
int j = 0;
for (i=0; i<=strlen(line); i++)
{
if(line[i] != '*')
{
formated[j] = line[i];
j = j+1;
}
if ((line[i] == '*') && (exist == false))
{
char pom[4]="<b>";
strcat(format, pom);
j=j+4;
exist=true;
}
if ((line[i] == '*') && (flaga == true))
{
char pom[5]="</b>";
strcat(format, pom);
j=j+5;
exist=true;
}
Thank You for advice