This is my code:
#include <iostream>
#include <iomanip>
#include "sha256.h"
#include <string>
#include <sstream>
using namespace std;
int main()
{
int a = 0;
int b = 1;
int h = 0;
string j = "80";
do
{
h++;
cout << j << hex << setfill('0') << setw(64) << h << endl;
}
while ( a < b );
return 0;
}
The code does this:
1. It increments the variable "h" by 1
2. Adds the 000000000000000000 padding that I need
3. converts it to hex
4. appends the 0x80 (See here:
https://en.bitcoin.it/wiki/Wallet_import_format)
How do I transfer the output to another variable instead of just using cout?
why don't you just throw whatever the result is into a temporary variable?
so the output variable would be C, then each time the loop runs have something increment C so you can have a count, so you can have it output like C1 = blah129832392 C2= b1293029301923 C3= 023940349fj2
are you talking about like that?
if this is all just outputting to a console, i would recommend you output into a database and preferably not a text document but you can.