j***i 发帖数: 2 | 1 #include
#include
#include
#include
#include
int main()
{
struct utmpx *U;
while ((U = getutxent())!=NULL) {
printf ( "%s", U -> ut_pid);
}
return 0;
}
I wrote these lines but it said that "Segmentation Fault (core dumped)"
Could you give me some suggestion. TX | s*******m 发帖数: 58 | 2 pid stuffs are generally integer, not string. maybe u->ut_pid = 0
【在 j***i 的大作中提到】 : #include : #include : #include : #include : #include : int main() : { : struct utmpx *U; : while ((U = getutxent())!=NULL) { : printf ( "%s", U -> ut_pid);
|
|