Home » Developer & Programmer » Precompilers, OCI & OCCI » code is not working properly
code is not working properly [message #163300] Thu, 16 March 2006 00:45
surbhigarg
Messages: 11
Registered: January 2006
Junior Member
hi
this the code,which is not giving the desired o/p.
compiing--->
gcc -o PMSServer Dog.c
[guest@oam PMSServer]$ ./PMSServer
Listener is running: Success


this code is not printing the value of bFlag
code-->

while(!feof(fp1))

                        {

                                if(fgets(str1,250,fp1) == NULL)

                                {

                                        perror("fgets");

                                        break;

                                }

if(strstr(str1,"tnslsnr") )

                                {

                                        if(!strstr(str1,"grep"))

                                                bFlag = 1;

                                        break;

                                }

                         }

                        fclose(fp1);


                        

                        if(bFlag==1)

                        {
                        printf("flag value is %d",bFlag);
                        perror("Listener is running");


                        }
Previous Topic: capture output from execl() or system()
Next Topic: A memory bug in Pro*C?
Goto Forum:
  


Current Time: Thu Mar 28 19:39:39 CDT 2024