有个项目要给客户发送随机验证码, 试了下这样可以
1 srand(time(0)); 2 code = [NSString stringWithFormat:@"%d", (rand() % (9999 - 1001)) + 1001];
有个项目要给客户发送随机验证码, 试了下这样可以
1 srand(time(0)); 2 code = [NSString stringWithFormat:@"%d", (rand() % (9999 - 1001)) + 1001];
转载于:https://www.cnblogs.com/zhouxihi/p/5990318.html