检查用户名是否存在int checkUsernameUser user int count char username int i; for i = 0; i count; i++ if strcmpuseriusername username == 0 return 1; printf账号不存在n; printf
入口参数:
- User user[]: 一个包含用户信息的数组
- int count: 数组中用户信息的数量
- char username[]: 待检查的用户名
出口参数:
- int: 返回一个整数值,表示用户名是否存在。存在则返回1,不存在则返回0。
原文地址: https://www.cveoy.top/t/topic/hS2f 著作权归作者所有。请勿转载和采集!