所以我陷入两难境地.我需要比较两个C风格的字符串,我搜索了最合适的函数:
memcmp //Compare two blocks of memory (function)
strcmp //Compare two strings (function )
strcoll //Compare two strings using locale (function)
strncmp //Compare characters of two strings (function)
strxfrm //Transform string using locale (function)
Run Code Online (Sandbox Code Playgroud)
我认为第一个是地址,所以这个想法就出来了.第二个听起来对我来说是最好的选择,但无论如何我想听到反馈.其他三个让我一无所知.
我想使用C编程访问Windows中的用户名,并使用该名称创建特定文件的路径,如"c:\ users\john\Roaming .....等".因此对于每个系统用户名,例如"john"是不同的.帮我在运行时找到用户名.