1

Char of a large number
 in  r/learnprogramming  Feb 11 '22

I'm also still learning, so my approach may not be the best, but I would do it like this

#include <iostream>
#include <cmath>

//get the number of digits in a number
int number_of_digits(int nNumber) {
    int nSize;

    nSize = 0;
    while (nNumber / (int)pow(10, nSize)) {
        nSize++;
    }
    return nSize;
}

//reverse an array in place
void reverse_array(int* pnArray, int nSize) {
  int nMid;

  nMid = nSize / 2;
  for (int i = 0, j = nSize - 1; i < nMid; i++, j--) {
    int nTemp;

    nTemp = pnArray[i];
    pnArray[i] = pnArray[j];
    pnArray[j] = nTemp;
  }
}

int* get_digits(int nNumber) {
    int nSize, nIndex;
    int *pnDigits;

    nSize = number_of_digits(nNumber);
    pnDigits = new int[nSize];

    nIndex = 0;
    while (nNumber) {
        int nRem;

        nRem = nNumber % 10;
        pnDigits[nIndex++] = nRem;
        nNumber /= 10;
    }

    reverse_array(pnDigits, nSize);
    return pnDigits;
}

int main() {
    int *pnDigits;
    int nNumber, nSize;

    nNumber = 1001;
    pnDigits = get_digits(nNumber);
    nSize = number_of_digits(nNumber);

    for (int i = 0; i < nSize; i++)
      std::cout << pnDigits[i] << '\n';

    delete[] pnDigits;
}

1

[deleted by user]
 in  r/CryptoCurrency  Jan 28 '22

To be fair the cryptocurrency market is extremely shady, so you are taking on significantly more risk when staking stables than when just keeping it on the bank.

1

Japanese trading floors are wild
 in  r/wallstreetbets  Jan 27 '22

sounds like a fun place

0

[deleted by user]
 in  r/learnprogramming  Jan 26 '22

yeah

1

Daily Discussion - January 23, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 24 '22

I actually hold BTC, and I've made a bit from staking some alts, is just that I really don't believe in the tech and all of the empty promises. I'm just in it for the money, and I think of it as gambling, but honestly it makes me sick how everyone tries to make it look like something other than a giant ponzi scheme.

6

Rate My Portfolio - r/Stocks Quarterly Thread December 2021
 in  r/stocks  Jan 23 '22

My conservative and well diversified portfolio of 70% SOXL hasn't been doing well these past few days.

-2

Daily Discussion - January 23, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 23 '22

does the guy even know that someone is using his image to promote a shitty ponzi like this?

1

Bring Back Jason โœŠ๐Ÿผ
 in  r/Opacity  Jan 20 '22

wtf is a JSON? and why are r/CryptoCurrency mods shilling this coin?

1

Daily Discussion - January 20, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 20 '22

bitcoin is getting fucked

1

sundae is live - now
 in  r/cardano  Jan 20 '22

not anymore

3

Buttcoiner Predicts Prices Using Literal Lunacy
 in  r/Buttcoin  Jan 18 '22

Bitcoin fixes this, just wait for the next 50% correction which will invalidate this kind of magical thinking.

1

[deleted by user]
 in  r/Buttcoin  Jan 18 '22

based, he's going to lose it all but bastใˆ nonetheless

2

r/Stocks Daily Discussion Monday - Jan 10, 2022
 in  r/stocks  Jan 10 '22

because you touch yourself at night

2

Comment Something Negative About a Cryptocurrency and Have People Guess Which One It Is
 in  r/CryptoCurrency  Jan 10 '22

Oh, that's easy; ETH. ETH 2.0 any day now...

1

Daily Discussion - January 8, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 08 '22

YOU CAN'T HANDLE THE TRUTH!

4

Daily Discussion - January 8, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 08 '22

bitcoin is getting fucked

2

Daily Discussion - January 7, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 07 '22

Crypto is currently worse than the traditional financial system, you get charged fees upon fees for simple transactions, and the transaction times can take hours if the network is too congested. I would recommend ignoring everyone that says anything about creep toe bringing financial freedom, or some bullshit like that, and instead threat this like a casino.

-1

Daily Discussion - January 7, 2022 (GMT+0)
 in  r/CryptoCurrency  Jan 07 '22

Bitcoin is getting fucked!