Unsigned Long Long overloads toCharArray?

unsigned long long test_var = 9223372036854775805;
String some_text;
char newchar[21];

void setup(void)
{
  String some_text =  String(test_var, DEC);
  some_text.toCharArray(newchar,21);
}

And I get this error message:

Arduino: 1.8.1 (Linux), Board: "Arduino/Genuino Uno"

/home/tbfunk/Arduino/sketch_feb21a/sketch_feb21a.ino: In function 'void setup()':
sketch_feb21a:7: error: call of overloaded 'String(long long unsigned int&, int)' is ambiguous
   String some_text =  String(test_var, DEC);
                                           ^
/home/tbfunk/Arduino/sketch_feb21a/sketch_feb21a.ino:7:43: note: candidates are:
In file included from /home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/Arduino.h:231:0,
                 from sketch/sketch_feb21a.ino.cpp:1:
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:73:11: note: String::String(double, unsigned char)
  explicit String(double, unsigned char decimalPlaces=2);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:72:11: note: String::String(float, unsigned char)
  explicit String(float, unsigned char decimalPlaces=2);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:71:11: note: String::String(long unsigned int, unsigned char)
  explicit String(unsigned long, unsigned char base=10);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:70:11: note: String::String(long int, unsigned char)
  explicit String(long, unsigned char base=10);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:69:11: note: String::String(unsigned int, unsigned char)
  explicit String(unsigned int, unsigned char base=10);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:68:11: note: String::String(int, unsigned char)
  explicit String(int, unsigned char base=10);
           ^
/home/tbfunk/Downloads/arduino-1.8.1/hardware/arduino/avr/cores/arduino/WString.h:67:11: note: String::String(unsigned char, unsigned char)
  explicit String(unsigned char, unsigned char base=10);
           ^
exit status 1
call of overloaded 'String(long long unsigned int&, int)' is ambiguous

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

However if I shorten it to an Unsigned Long it compiles fine but is 32 bit instead of 64 which I want.

unsigned long test_var = 9223372036854775805;
String some_text;
char newchar[21];

void setup(void)
{
  String some_text =  String(test_var, DEC);
  some_text.toCharArray(newchar,21);
}

Help?

Thanks Delta,

I tried sprintf and it doesnt seem to do anything. Maybe I have it formatted incorrectly?

unsigned long long test_var = 9223372036854775805;
char newchar[21];

void setup(void)
{
  sprintf(newchar, "%lld", test_var);
  output2OLED(newchar, 3);
}

What I am trying to do is display a 64 bit integer as decimal on my OLED display which takes input in the form of a char array. itoa() worked for this until i used a 64 bit integer.

Im not sure how to print to the serial monitor? I am having no issues displaying text and numbers and everything I want on my OLED except when it comes to long long's which I am new to using.

If I format it as %lld the OLED shows the error characters.

"sprintf(newchar, "%lld", test_var);"

If I format it as %u it displays 6553311
And if I format it as %ulld it displays 6553311lld

Reading on C library function - sprintf()
I cant seem to find mention of the function being built to deal with long long and there is no mention of lowercase L being used in the format.

I am not so new to C however I AM new to arduino so I apologise.

Is it possible arduino cannot handle long long's? or am I going about 64 bit integers wrong?

I get the same results printing to the serial monitor which I wrongly assumed would print to the error message area not its own window.

When I try to print long long to the serial monitor it says:

"test test 4294967293"

  Serial.begin(115200);
  Serial.print("test ");
  unsigned long long test_var = 9223372036854775805;
  unsigned long test_var2 = 9223372036854775805;
  char newchar[21];
  char newchar2[21];
  sprintf(newchar, "%20llu", test_var);
  sprintf(newchar2, "%20lu", test_var2);
  Serial.print(newchar);
  Serial.print(" test ");
  Serial.print(newchar2);

It seems that I cannot get it to work so I believe you may be right.
The largest number I seems to be able to deal with is 32bit which I am okay with since I can use 2 of those to accomplish what I want to do.

Thank you so very much Delta_G for your help!

http://nongnu.org/avr-libc/user-manual/group__avr__stdio.html#gaa3b98c0d17b35642c0f3e4649092b9f1

But the ll length modifier will to abort the output, as this realization does not operate long long arguments.