Input a password from the user and check if it has a char, alphabet and digit

前端 未结 4 381
梦谈多话
梦谈多话 2021-01-23 19:48

My doubt is that, the program works fine if I enter a password that fills the array. However if I enter a password such as \"apple25\", I think it counts the blank spaces in the

4条回答
  •  别那么骄傲
    2021-01-23 20:07

    There are several issues here:

    • Try entering a password with a size of 10 or longer. You'd overflow arr.
    • You don't stop at the terminating NULL character (value 0). In fact, you count the terminating NULL as "character" and increase c when you come across it.
    • Any garbage afterward is also processed.

提交回复
热议问题