Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Long pointer to character C++ Pin
Stefan_Lang28-Nov-12 22:03
Stefan_Lang28-Nov-12 22:03 
AnswerRe: Long pointer to character C++ Pin
CPallini28-Nov-12 7:48
mveCPallini28-Nov-12 7:48 
AnswerRe: Long pointer to character C++ Pin
Sajeesh Payolam30-Nov-12 18:35
Sajeesh Payolam30-Nov-12 18:35 
AnswerRe: Long pointer to character C++ Pin
April Fans13-Dec-12 18:06
April Fans13-Dec-12 18:06 
Questionproblem in c with linux Pin
a1_shay28-Nov-12 2:23
a1_shay28-Nov-12 2:23 
AnswerRe: problem in c with linux Pin
CPallini28-Nov-12 3:07
mveCPallini28-Nov-12 3:07 
SuggestionRe: problem in c with linux Pin
Richard MacCutchan28-Nov-12 3:11
mveRichard MacCutchan28-Nov-12 3:11 
GeneralRe: problem in c with linux Pin
a1_shay28-Nov-12 21:35
a1_shay28-Nov-12 21:35 
C++
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void main()
{
    char *arr[5];//for the command and his parameter
    char command[10];
    int i,j;
    char *path=NULL,*tempath,*finalpath,*commandandparameters;
    do
    {
        i=0;
        printf("enter new command:");
        gets(command);
        arr[i]=strtok(command," ");
        while(arr[i]!=NULL)//save the command and also the parametrs
        {
            i++;
            arr[i]=strtok(NULL," ");
        }
        strcpy(commandandparameters,arr[0]);//add first command
        for(j=1;j<i;j++)//add the parameters
            {
                strcat(commandandparameters," ");
                strcat(commandandparameters,arr[j]);
            }
        //now we check if the command in every path
        path = getenv("PATH");
        tempath = strtok(path,":");
        while (tempath != NULL)
        {
            strcpy(finalpath,tempath);//get the current path
            puts(commandandparameters);
            strcat(finalpath,"/");//we add '/'
            execl(finalpath,commandandparameters,NULL);
            tempath = strtok(NULL, ":");//get next path
        }
    }while(command!="leave");
}

GeneralRe: problem in c with linux Pin
Richard MacCutchan28-Nov-12 23:04
mveRichard MacCutchan28-Nov-12 23:04 
AnswerRe: problem in c with linux Pin
Sajeesh Payolam30-Nov-12 18:40
Sajeesh Payolam30-Nov-12 18:40 
QuestionMerging Arrays Pin
pix_programmer27-Nov-12 21:57
pix_programmer27-Nov-12 21:57 
AnswerRe: Merging Arrays Pin
Andy41127-Nov-12 22:48
Andy41127-Nov-12 22:48 
AnswerRe: Merging Arrays Pin
CPallini27-Nov-12 23:09
mveCPallini27-Nov-12 23:09 
JokeRe: Merging Arrays Pin
Richard MacCutchan27-Nov-12 23:45
mveRichard MacCutchan27-Nov-12 23:45 
JokeRe: Merging Arrays Pin
CPallini27-Nov-12 23:58
mveCPallini27-Nov-12 23:58 
GeneralRe: Merging Arrays Pin
David Crow28-Nov-12 5:36
David Crow28-Nov-12 5:36 
AnswerRe: Merging Arrays Pin
Stefan_Lang28-Nov-12 2:45
Stefan_Lang28-Nov-12 2:45 
AnswerRe: Merging Arrays Pin
Sajeesh Payolam30-Nov-12 18:47
Sajeesh Payolam30-Nov-12 18:47 
QuestionHow to use ribbon in MFC Activex control Pin
Lamourou27-Nov-12 20:23
Lamourou27-Nov-12 20:23 
AnswerRe: How to use ribbon in MFC Activex control Pin
Richard MacCutchan27-Nov-12 23:44
mveRichard MacCutchan27-Nov-12 23:44 
GeneralMessage Closed Pin
28-Nov-12 0:26
Lamourou28-Nov-12 0:26 
GeneralRe: How to use ribbon in MFC Activex control Pin
Richard MacCutchan28-Nov-12 1:10
mveRichard MacCutchan28-Nov-12 1:10 
Questionhow to use more than one rc file in vc6 project at the same time when compiling project Pin
yingkou27-Nov-12 19:59
yingkou27-Nov-12 19:59 
AnswerRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
Richard MacCutchan27-Nov-12 23:42
mveRichard MacCutchan27-Nov-12 23:42 
GeneralRe: how to use more than one rc file in vc6 project at the same time when compiling project Pin
yingkou28-Nov-12 14:35
yingkou28-Nov-12 14:35 

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.