find_brkt()
By SalimMeghani
- 244 reads
//
void find_brkt(int *error, char *form, int *start, int *end, int *bracket, int *length)
{
int loop,
loop2,
rgtbrac=0;
loop=loop2=0;
*length=strlen(form);
*bracket=0;
for (loop=0; loop<=*length; loop++)
{
if (form[loop]=='(')
{
*bracket=1;
*start=loop;
}
if (form[loop]==')')
rgtbrac=1;
//
}
if (*bracket)
{
loop2=*start+1;
*bracket=0;
do
{
if (form[loop2]==')')
{
*end=loop2;
*bracket=1;
}
loop2++;
}
while ((!*bracket) && (form[loop2]!='%'));
}
//
}
- Log in to post comments