コードが最初に行く:itoaは
template <typename T>
void do_sth(int count)
{
char str_count[10];
//...
itoa(count, str_count, 10);
//...
}
が、私はこのようにいくつかのコンパイルエラーが発生しました:
error: there are no arguments to ‘itoa’ that depend on a template parameter, so a declaration of ‘itoa’ must be available
error: ‘itoa’ was not declared in this scope
しかし、私は確かに<cstdlib>
が含まれています。 何が間違っているのか教えてください。
printf、operator <<(ostream&、int)、昇格カルマ、昇順形式、lexical_castなどをやり直そうとしていますか? – sehe
@dimitri、私は両方の方法を試しましたが、何も動作しません。代わりにstringstreamを使用します。 – Alcott