y=0;
//clear out array for next line
for (a=0;a<80;a++) extrct[a]=NULL;

// get line
do
{
fread(buf,1,1,f2);
y++;

if (y==1) strcpy(buffer1,buf);
else strcat(buffer1,buf);

if (feof(f2))
{
done=TRUE; goto lbl;
}
} while (buf[0]!=10);
lbl:
// parse out name of dml
fc=0;
for (a=0;a<strlen(buffer1);a++)
{
// if not parse char then build string
if (buffer1[a]!=47)
{
if (fc!=0)
{
buf[0]=buffer1[a];
strcat(extrct,buf);
}
else
{
fc++;
buf[0]=buffer1[a];
strcpy(extrct,buf);
}
}
else
{
// if parse char then check to see if we have gottent the name
// of the dml.
fc=0;
ptr=strstr(extrct,"dml");
if (ptr!=NULL)

No, since the label is before the ending bracket of the while loop, your label needs to appear as a statement ending with a semi-colon. Instead of goto skip_it; try:
if ( (tmp1==0) || (tmp2==0) ) continue;

>> Is there any kind of limits of labels and goto statements?? Is there any kind of rules??

1) The label must be followed by a statement (even if it is an empty statement).

2) The label must be in the same function as the goto statement.
(You can use setjmp/longjmp for non-local goto. Good for REALLY incomprehensible code).

3) It is illegal to jump past a declaration with an initializer unless:
* The declaration is enclosed in a block that is not entered.
* The jump is from a point where the variable has already been initialized.

Hello !
I am having solution for your problem without usint labels. As per software standards
you better to avoid using GOTO statements. It is worst practice using GOTO statements.
Here I am slightly modifying your code, wherever I modify,I am passing comments against on each statements which are modified by me. I hope this will solve your
problem.
Thanks and Regards - SGANTA

y=0;
//clear out array for next line
for (a=0;a<80;a++) extrct[a]=NULL;

// get line
do
{
fread(buf,1,1,f2);
y++;

if (y==1) strcpy(buffer1,buf);
else strcat(buffer1,buf);

if (feof(f2))
{
done=TRUE;
break; /* It will come out from do while loop that is equivalent to
goto lbl; */
}
} while (buf[0]!=10);

/* Here I had removed lbl : */

// parse out name of dml
fc=0;
for (a=0;a<strlen(buffer1);a++)
{
// if not parse char then build string
if (buffer1[a]!=47)
{
if (fc!=0)
{
buf[0]=buffer1[a];
strcat(extrct,buf);
}
else
{
fc++;
buf[0]=buffer1[a];
strcpy(extrct,buf);
}
}
else
{
// if parse char then check to see if we have gottent the name
// of the dml.
fc=0;
ptr=strstr(extrct,"dml");
if (ptr!=NULL)

{
break; /* Here it will come out from for loop that is equivalent to
goto endLoop; */
}
}
} // end of for loop

//compare and if == then write out
strcpy(extrct,extrct2);
tmp1=strcmp(extrct,"sort");
tmp2=strcmp(extrct,"writeoff");

if ( !((tmp1==0) || (tmp2==0)) ) /* Here I have modified your if statement
which will execute for statement
only if not (tmp1 == 0 or tmp2 ==0)
which is equivalent to skip it if it is
false */
/* I had removed goto skip_it */

Hai kellyjj !
I am not worrying about points. You have to justify it.
I know how to use labels, but it is worst practice to use GOTO statement as per
the SOFTWARE standards.
So, that is why I took the pain to DEBUG and MODIFIED your code.
You have to justify it. About LABELS alexo is also correct.
Please justify the answer. GOD LOVES YOU - sganta

Thanks for your effort. However, I did not ask for alternate ways of doing it. I am aware of commands like 'break' and continue. What I was asking was for the rules/limits of using labels, and what was wrong with the label I was using. alexo rules pointed out to me exectly what I was doing wrong.

I will not argue that fact that using labels is not considered 'standard' coding practices. And I do believe a over use of them can be rather confusing. I do not think my code was an over use of them. As a matter of fact if I was writing this code in assembler I would have have used something like 'je skip_it' as due to the fact that I don't want to jump far. In other parts of my program I do use break.

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Preface
I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…