Click here to Skip to main content
16,011,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple MFC App VS2005 Pin
S Douglas19-Jan-06 22:51
professionalS Douglas19-Jan-06 22:51 
AnswerRe: Simple MFC App VS2005 Pin
Michael Dunn19-Jan-06 22:59
sitebuilderMichael Dunn19-Jan-06 22:59 
GeneralRe: Simple MFC App VS2005 Pin
S Douglas19-Jan-06 23:16
professionalS Douglas19-Jan-06 23:16 
QuestionParse main arguments in C Pin
bouli19-Jan-06 20:59
bouli19-Jan-06 20:59 
AnswerRe: Parse main arguments in C Pin
ThatsAlok19-Jan-06 21:14
ThatsAlok19-Jan-06 21:14 
GeneralRe: Parse main arguments in C Pin
bouli19-Jan-06 22:51
bouli19-Jan-06 22:51 
GeneralRe: Parse main arguments in C Pin
ThatsAlok19-Jan-06 23:00
ThatsAlok19-Jan-06 23:00 
AnswerRe: Parse main arguments in C Pin
Rage19-Jan-06 21:48
professionalRage19-Jan-06 21:48 
"in C", do you mean with the standard main function ? Here are the parameters :

main
main( int argc, char *argv[ ])
{
program-statements
}

The main function marks the beginning and end of program execution. A C or C++ program must have one function named main. 

The main and wmain functions can take the following three optional arguments, traditionally called argc, argv (in that order):

argc

An integer specifying how many arguments are passed to the program from the command line. Because the program name is considered an argument, argc is at least 1.

argv

An array of null-terminated strings. It can be declared as an array of pointers to char (char *argv[ ] ) or as a pointer to pointers to char (char **argv ). The first string (argv[0]) is the program name, and each following string is an argument passed to the program from the command line. The last pointer (argv[argc]) is NULL.


So with argc you have the number of parameter give nto the command line, and these parameters are contained in argv.

~RaGE();
GeneralRe: Parse main arguments in C Pin
bouli19-Jan-06 22:52
bouli19-Jan-06 22:52 
GeneralRe: Parse main arguments in C Pin
Rage19-Jan-06 23:28
professionalRage19-Jan-06 23:28 
GeneralRe: Parse main arguments in C Pin
David Crow20-Jan-06 3:30
David Crow20-Jan-06 3:30 
GeneralRe: Parse main arguments in C Pin
bouli20-Jan-06 4:58
bouli20-Jan-06 4:58 
GeneralRe: Parse main arguments in C Pin
David Crow20-Jan-06 5:12
David Crow20-Jan-06 5:12 
GeneralRe: Parse main arguments in C Pin
Blake Miller20-Jan-06 4:17
Blake Miller20-Jan-06 4:17 
AnswerRe: Parse main arguments in C Pin
David Crow20-Jan-06 3:31
David Crow20-Jan-06 3:31 
QuestionProblem with Mouse Message Pin
Naveen_mah19-Jan-06 20:24
Naveen_mah19-Jan-06 20:24 
AnswerRe: Problem with Mouse Message Pin
Owner drawn19-Jan-06 20:32
Owner drawn19-Jan-06 20:32 
QuestionRe: Problem with Mouse Message Pin
Naveen_mah19-Jan-06 21:58
Naveen_mah19-Jan-06 21:58 
AnswerRe: Problem with Mouse Message Pin
Owner drawn19-Jan-06 22:15
Owner drawn19-Jan-06 22:15 
Questionwarning C4018: '<' : signed/unsigned mismatch Pin
Chintoo72319-Jan-06 19:13
Chintoo72319-Jan-06 19:13 
AnswerRe: warning C4018: '<' : signed/unsigned mismatch Pin
kakan19-Jan-06 19:17
professionalkakan19-Jan-06 19:17 
GeneralRe: warning C4018: '<' : signed/unsigned mismatch Pin
Chintoo72319-Jan-06 19:18
Chintoo72319-Jan-06 19:18 
GeneralRe: warning C4018: '&lt;' : signed/unsigned mismatch Pin
toxcct19-Jan-06 22:39
toxcct19-Jan-06 22:39 
GeneralRe: warning C4018: '<' : signed/unsigned mismatch Pin
Rage19-Jan-06 23:33
professionalRage19-Jan-06 23:33 
GeneralRe: warning C4018: '&lt;' : signed/unsigned mismatch Pin
toxcct19-Jan-06 23:38
toxcct19-Jan-06 23:38 

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.