Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: tcp in C++? Pin
mmavipc1-Apr-07 13:51
mmavipc1-Apr-07 13:51 
GeneralRe: tcp in C++? Pin
ThatsAlok1-Apr-07 23:01
ThatsAlok1-Apr-07 23:01 
GeneralRe: tcp in C++? Pin
Mark Salsbery2-Apr-07 6:18
Mark Salsbery2-Apr-07 6:18 
Questionoverriding SIGINT Pin
xface661-Apr-07 7:16
xface661-Apr-07 7:16 
QuestionCustomizing Edit Control Pin
Super Hornet1-Apr-07 6:55
Super Hornet1-Apr-07 6:55 
AnswerRe: Customizing Edit Control Pin
Hamed Musavi1-Apr-07 8:46
Hamed Musavi1-Apr-07 8:46 
AnswerRe: Customizing Edit Control Pin
ThatsAlok1-Apr-07 23:01
ThatsAlok1-Apr-07 23:01 
Questionpwd command Pin
Arif Liminto1-Apr-07 5:00
professionalArif Liminto1-Apr-07 5:00 
hi iam making a program to implement pwd command under unix environment.. but the result is always segmentation fault, i think my code is alright, can you give me a solution? thanks

#include<stdio.h>
#include<sys stat.h="">
#include<sys types.h="">
#include<pwd.h>
#include<dirent.h>
#include<grp.h>
#include<stdlib.h>
#include<string.h>
int main()
{
struct dirent *ds = 0;
DIR *dirp = 0;
struct stat sbuf;
char pathname[1024];
char *dirname;
struct passwd *pw;
struct group *gr;

dirname = ".";
dirp = opendir(dirname);


if(dirp)
{
strcpy(pathname,dirname);
strcat(pathname,"/");
strcat(pathname,ds->d_name);
lstat(pathname,&sbuf);

pw = getpwuid(sbuf.st_uid);
gr = getpwuid(sbuf.st_gid);

printf("%-8s \n",pw->pw_dir);
}


return(0);
}
AnswerRe: pwd command Pin
CPallini1-Apr-07 6:09
mveCPallini1-Apr-07 6:09 
GeneralRe: pwd command Pin
Eytukan1-Apr-07 6:14
Eytukan1-Apr-07 6:14 
GeneralRe: pwd command Pin
CPallini1-Apr-07 7:33
mveCPallini1-Apr-07 7:33 
GeneralRe: pwd command Pin
Eytukan1-Apr-07 19:56
Eytukan1-Apr-07 19:56 
QuestionHow to notice socket disconnection? [modified] Pin
Hamed Musavi1-Apr-07 4:29
Hamed Musavi1-Apr-07 4:29 
AnswerRe: How to notice socket disconnection? Pin
Eytukan1-Apr-07 4:54
Eytukan1-Apr-07 4:54 
GeneralRe: How to notice socket disconnection? Pin
Hamed Musavi1-Apr-07 5:19
Hamed Musavi1-Apr-07 5:19 
GeneralRe: How to notice socket disconnection? Pin
Eytukan1-Apr-07 5:48
Eytukan1-Apr-07 5:48 
GeneralRe: How to notice socket disconnection? Pin
Hamed Musavi1-Apr-07 5:53
Hamed Musavi1-Apr-07 5:53 
GeneralRe: How to notice socket disconnection? Pin
Eytukan1-Apr-07 5:57
Eytukan1-Apr-07 5:57 
AnswerRe: How to notice socket disconnection? Pin
ThatsAlok1-Apr-07 22:29
ThatsAlok1-Apr-07 22:29 
GeneralRe: How to notice socket disconnection? Pin
Hamed Musavi2-Apr-07 1:56
Hamed Musavi2-Apr-07 1:56 
AnswerRe: How to notice socket disconnection? Pin
Sachin R Sangoi2-Apr-07 1:17
Sachin R Sangoi2-Apr-07 1:17 
GeneralRe: How to notice socket disconnection? Pin
Hamed Musavi2-Apr-07 1:50
Hamed Musavi2-Apr-07 1:50 
Questionretrieve registry key path from HKEY Pin
bahaa1236541-Apr-07 2:53
bahaa1236541-Apr-07 2:53 
AnswerRe: retrieve registry key path from HKEY Pin
Eytukan1-Apr-07 6:13
Eytukan1-Apr-07 6:13 
GeneralRe: retrieve registry key path from HKEY Pin
bahaa1236541-Apr-07 6:53
bahaa1236541-Apr-07 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.