n*******r 发帖数: 60 | 1 I put a group of Popen command before a function, it is fine.
However, when I put it into a function, it showed always Bus Error
The following is the code
if ((ptr = popen(cmd, "r")) != NULL
{
while (fgets(bufPS, 40, ptr) != NULL)
{
(void) printf("%s", bufPS);
(void) strcat(bufPine,bufPS);
}
pclose(ptr);
}
Help me please!!! |
|