In the main function of C:
void main(int argc, char **argv)
{
// do something here
}
In the command line, we will type any number for example 1
or 2
as input, but it will be treated as char array for the parameter of argv, but how to make sure the input is a number, in case people typed hello
or c
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…