문자열 변수 string time
을 만들어야하고 14:58
처럼 보일 것입니다.
나는 기능C++ 오류 LNK2019
string SetTime() {
long double h = (long double)(rand()%25);
long double m = (long double)(rand()%60);
string hour = to_string(h);
string minutes = (m <= 9 ? "0" : "") + to_string(m);
string time = hour + ":" + minutes;
return time;
}
을 만들었지 만 내가하려고 할 때
가 무슨 일이야 error LNK2019: link to unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl SetNumber(void)" ([email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ) in _wmain
얻는 방법과 그것을 해결하기 위해 그것을
string str = SetNumber();
cout << str;
을 사용할 수 있나요?
SetNumber/SetTime 함수 호출을 혼합하고 있습니까? – billz
예, 두 가지 기능이 혼합되었습니다. 죄송합니다. – Heidel