Home > Back-end >  Vs2010 code input file name automatically after the process
Vs2010 code input file name automatically after the process

Time:04-22

Question:
After download the open source code format in accordance with the requirements of the input file, would prompt "press any key to continue,,,," or CMD command automatically directly out of the window,

Specific:
Set breakpoints, step through found procedure should be read to me the input to the command line, arg c=1 directly according to the program for the output text is directly exit, scan the code feel very strange, this is a very old model, internal code for this is certainly true, do not need to modify, don't know what is going wrong, the code is as follows:
 # include & lt; Stdio. H> 
#include
#include
#include

# include "config. H"
# include "tMCimg. H"
# include "McCore. H"

# define the USAGE printf (" options: if the string contains... "\ \ n
"\ t? - display the option help (this) \ n \
""\ tn - inhibit. 2 pt file storage and dump \ n" \
"\ tR - Use normal C ordering for segmentation/. 2 pt files \ n" \
"\ ts - don 't move sources to the boundary \ n \
""\ td - don 't move detectors to the boundary \ n \
""\ tt - write exact exit time to.. ihs. T home tgate # to. Ihs \ n" \
"\ tm - make tissue - air boundaries perfectly mirrored \ n \ n")

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Function as the Function prototype
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

The static void run_simulation (const struct Config *, const TISSUE * * *,
TWOPT_T *, TWOPT_T *, const char *);

Extern void run_photon (const struct Config *, int, const TISSUE * * *,
TWOPT_T TWOPT_T *, *, FILE *, int *);

Void write_photon (const struct Config *, FILE *, double, double, double,
Double, double, double, double, float *);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
BEGIN the PROGRAM CODE
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Int main (int arg c, char * argv [])
{
Struct Config syscfg;/* the System configuration, constructed
. * from the CFG file */
II TWOPT_T * * JJ; 2 - PT/* FOR STORING THE FLUENCE */
TISSUE * * * tissueType;/* STORE THE IMAGE FILE */
Int I, j, n, nvox;

/* the Initialize the configuration structure 's memory */

Initialize_config (& amp; Syscfg);

/* GET THE COMMAND LINE ARGUMENT (S) */

If (arg c==1)
{
Printf (" tMCimg version 8.0% c \ n ", 'A' + 0);
Printf (" the USAGE: : tMCimg [- opts] input_file (. CFG assumed) \ n ");

The USAGE;

Printf (" Default options: \ n ");
Printf (" \ t2pt files % s be generated \ n ",
(syscfg. Flags. Gen_twopt!=0)? "Will" : "will not");
Printf (" % s \ t - ordered data files \ n ",
(syscfg. Flags. Matlab_order!=0)? "Matlab" : "C");
Printf (" \ to interface tSources % s \ n ",
(syscfg. Flags. Source_move!=0)? "Version" : "not version");
Printf (" \ to interface tDetectors % s \ n ",
(syscfg. Flags. Detector_move!=0)? "Version" : "not version");
Printf (" \ tExiting to interface photons % s \ n ",
(syscfg. Flags. Exiting_move!=0)? "Version" : "not version");
Printf (" % s \ t recorded in the history file \ n ",
(syscfg. Flags. Exact_exit_time!=0)?
"Exact exit times" : "the Time indices");
If (syscfg. The flags. The mirror!=0)
Printf (" \ tMirrored air boundaries \ n ");
printf("\n");

getchar();

return 1;
}

This code is the final getchar (); After I added, or command window will be a flash, do not give the opportunity of the input file,
Step through the program runs to return 1; Will jump out of the whole int, withdrew from the end of the process operation,
But this program is running normal process should be read I input string and then to the following program is now didn't enter the program ended, true don't understand, passing by the great god,
At the back of the program is like that, I don't understand him recognize me input command line
 else 
For (I=1; I & lt; Arg c; I++)
{
If (argv [I] [0]=='-')/* introduces option flags */
{
/* search through the command line option words to find
* meaningful chars... */

For (j=1; Argv [I] [j].='\ 0'; J++)
The switch (argv [I] [j])
{
Case 'm:
Syscfg. Flags. Mirror=! Syscfg. Flags. Mirror;
Printf (" Tissue - air boundaries % s be mirrored. \ n ",
(syscfg. Flags. Mirror? "Will" : "will not"));
break;
Case 'n' :
Syscfg. Flags. Gen_twopt=! Syscfg. Flags. Gen_twopt;
Printf (" The 2 pt be generated. The file % s \ n ",
(syscfg. Flags. Gen_twopt? "Will" : "will not"));
break;
Case "R" :
Syscfg. Flags. Matlab_order=! Syscfg. Flags. Matlab_order;
Printf (" be saved in the order. The matlab Data % s \ n ",
(syscfg. Flags. Matlab_order? "Will" : "will not"));
break;
Case 'd' :
Syscfg. Flags. Detector_move=! Syscfg. Flags. Detector_move;
Printf (" be Detectors % s version to interface. \ n ",
(syscfg. Flags. Detector_move? "Will" : "will not"));
break;
In case the 's' :
Syscfg. Flags. Source_move=! Syscfg. Flags. Source_move;
Printf (" Source % s be version to interface. \ n ",
(syscfg. Flags. Source_move? "Will" : "will not"));
break;
Case 'e' :
Syscfg. Flags. Exiting_move=! Syscfg. Flags. Exiting_move;
Printf (" Exiting photons % s be version to a boundary. \ n ",
(syscfg. Flags. Exiting_move? "Will" : "will not"));
break;
In case the 't' :
Syscfg. Flags. Exact_exit_time=! Syscfg. Flags. Exact_exit_time;
Printf (" History record the file % s exact exit times. \ n ",
(syscfg. Flags. Exact_exit_time? "Will" : "will not"));
break; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related