Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Richard MacCutchan10-Apr-12 5:34
mveRichard MacCutchan10-Apr-12 5:34 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:42
Falconapollo10-Apr-12 22:42 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Richard MacCutchan11-Apr-12 0:01
mveRichard MacCutchan11-Apr-12 0:01 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Tox1k10-Apr-12 15:09
Tox1k10-Apr-12 15:09 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:41
Falconapollo10-Apr-12 22:41 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
ThatsAlok10-Apr-12 22:23
ThatsAlok10-Apr-12 22:23 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:39
Falconapollo10-Apr-12 22:39 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Randor 11-Apr-12 4:26
professional Randor 11-Apr-12 4:26 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo11-Apr-12 4:34
Falconapollo11-Apr-12 4:34 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Nelek12-Apr-12 12:59
protectorNelek12-Apr-12 12:59 
QuestionIsUserAdmin returns false when UAC is enabaled in VS2010 Pin
V K 29-Apr-12 20:46
V K 29-Apr-12 20:46 
AnswerRe: IsUserAdmin returns false when UAC is enabaled in VS2010 Pin
Jochen Arndt9-Apr-12 21:12
professionalJochen Arndt9-Apr-12 21:12 
AnswerRe: IsUserAdmin returns false when UAC is enabaled in VS2010 Pin
jkirkerx11-Apr-12 11:54
professionaljkirkerx11-Apr-12 11:54 
Questionhow to achieve the effect like vmware?? Pin
Jing_K9-Apr-12 19:21
Jing_K9-Apr-12 19:21 
AnswerRe: how to achieve the effect like vmware?? Pin
Richard MacCutchan9-Apr-12 21:07
mveRichard MacCutchan9-Apr-12 21:07 
GeneralRe: how to achieve the effect like vmware?? Pin
ThatsAlok10-Apr-12 22:24
ThatsAlok10-Apr-12 22:24 
GeneralRe: how to achieve the effect like vmware?? Pin
Richard MacCutchan11-Apr-12 0:01
mveRichard MacCutchan11-Apr-12 0:01 
Questionsyntax errors? Pin
connect2janu9-Apr-12 13:46
connect2janu9-Apr-12 13:46 
q1: C programme that accepts valid file names as command line arguments and for each of the arguments, prints the type of the file (regular file, directory file, character special file, block special file,
symbolic link, etc)


#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>

int main(int argc,char *argv[])
{
int i;
struct stat buf;

for(i=1;i<argc;i++)
{
printf("%s",argv[i]);
if(lstat(argv[i],&buf)==-1)
{
printf(" Lstat error\n");
continue;
}
if(S_ISREG(buf.st_mode))
printf(" Regular file\n");
if(S_ISDIR(buf.st_mode))
printf(" Directory file\n");

if(S_ISCHR(buf.st_mode))
printf(" Character file\n");
if(S_ISBLK(buf.st_mode))
printf(" Block file\n");
if(S_ISLNK(buf.st_mode))
printf(" Symbolic link file\n");
}
}
/////////////////////////////////////////////////////
q2: C programme to do the following: Using fork() create a child process. The child process prints its own process id and id of its parent and then exits. The parent waits for the childto finish(by executing wait()) and prints its own process id and the id of its child and then exits.


#include <stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<sys/types.h>


int main()
{
pid_t ppid,mpid,pid,status=0;
pid=fork();
if(pid<0)
{
printf("Error");
exit(0);
}

if(pid==0)
{
mpid=getpid();
printf("\n I am child, my id is %d",mpid);
ppid=getppid();
printf("\n I am parent, my id is %d ",ppid);
exit(1);
}

pid=waitpid(pid,&status,0);
mpid=getpid();
printf("\n I am parent with id %d and my child is %d \n",mpid,pid);
}

both giving sysntax error,where is the mistake,can any rectify it,i have tried[in fedora 12-linux] i couldnt got solution
AnswerRe: syntax errors? Pin
David Crow9-Apr-12 17:22
David Crow9-Apr-12 17:22 
AnswerRe: syntax errors? Pin
Malli_S9-Apr-12 18:47
Malli_S9-Apr-12 18:47 
QuestionThe questions we get these days! PinPopular
Erudite_Eric9-Apr-12 6:45
Erudite_Eric9-Apr-12 6:45 
AnswerRe: The questions we get these days! Pin
Chuck O'Toole9-Apr-12 7:59
Chuck O'Toole9-Apr-12 7:59 
GeneralRe: The questions we get these days! Pin
Richard MacCutchan9-Apr-12 8:05
mveRichard MacCutchan9-Apr-12 8:05 
AnswerRe: The questions we get these days! Pin
Chuck O'Toole9-Apr-12 8:10
Chuck O'Toole9-Apr-12 8:10 
GeneralRe: The questions we get these days! Pin
PJ Arends9-Apr-12 9:44
professionalPJ Arends9-Apr-12 9:44 

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.