【发布时间】:2011-09-13 16:33:36
【问题描述】:
我希望用户输入密码。当然这是一个秘密密码,所以没有人应该看到它。 所以我试图用'*'替换用户输入的字母和数字。这是我的尝试。
while ((pw=getch())!='x'){
cout << "*";
strcpy(pwstring,pw);
}
input_pw=atoi(pwstring.c_str());
稍后我希望“x”成为“输入”。但目前这并不重要。有了这个,我在 Visual Studio 下得到了一些编译器错误。
Fehler 3
error C2664: 'strcpy': Konvertierung des Parameters 1 von 'char' in 'char *' nicht möglich c:\users\tim\desktop\kalssnne\methoden.h zeile: 70
我会试着翻译一下。
error 3
error C2664: 'strcpy': converting of parameter 1 from 'char' to 'char*' is not possible.
official english error code
"'function' : cannot convert parameter number from 'type1' to 'type2'"
thank u: R. Martinho Fernandes
但这意味着什么,我该如何解决?
希望你能帮助我
问候。
【问题讨论】:
-
你的变量有哪些类型?声明在哪里?
-
错误的official English text是:"'function' : cannot convert parameter number from 'type1' to 'type2'" 谢谢错误代码。
-
strcpy并没有按照你的想法去做。 -
@R. Martinho Fernandes 下次我会记得的;D