string convert_binary_to_hex(string binary_value)
{
bitset<8> set(binary_value);
cout << hex << set.to_ulong() << endl; // this is the output that I want to store to a variable to return
return "";
}
私は以前にCをしていません。 = DC++:何かがコンソールに送信されています:代わりに、それを変数に保存するにはどうしたらいいですか?
EDIT: ユーザーが提案しostringstream:、私の輸入も
main.cpp:20: error: aggregate ‘std::ostringstream result’ has incomplete type and cannot be defined
:
#include <stdio.h>
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
どういう意味ですか? – NullVoxPopuli
のような... cstの代わりにostringstream varName? – NullVoxPopuli
@DerNalia私は答えを広げました。 – NPE