Skip to main content
added 20 characters in body
Source Link
Mikael Patel
  • 8k
  • 2
  • 16
  • 21

You might be looking for a function that returns the textual representation of a long number. In that case there is actually aan AVR standard library function (ltoaavr-libc:stdlib.h ltoa):

const size_t BUF_MAX = 32;
char buf[BUF_MAX];
const int RADIX = 10;

long myLong = 12345L;
ltoa(myLong, buf, RADIX);

The buffer, buf, will contain the textual representation of the number, myLong, in the given RADIX.

Cheers!

You might be looking for a function that returns the textual representation of a long number. In that case there is actually a standard function (ltoa):

const size_t BUF_MAX = 32;
char buf[BUF_MAX];
const int RADIX = 10;

long myLong = 12345L;
ltoa(myLong, buf, RADIX);

The buffer, buf, will contain the textual representation of the number, myLong, in the given RADIX.

Cheers!

You might be looking for a function that returns the textual representation of a long number. In that case there is actually an AVR standard library function (avr-libc:stdlib.h ltoa):

const size_t BUF_MAX = 32;
char buf[BUF_MAX];
const int RADIX = 10;

long myLong = 12345L;
ltoa(myLong, buf, RADIX);

The buffer, buf, will contain the textual representation of the number, myLong, in the given RADIX.

Cheers!

Source Link
Mikael Patel
  • 8k
  • 2
  • 16
  • 21

You might be looking for a function that returns the textual representation of a long number. In that case there is actually a standard function (ltoa):

const size_t BUF_MAX = 32;
char buf[BUF_MAX];
const int RADIX = 10;

long myLong = 12345L;
ltoa(myLong, buf, RADIX);

The buffer, buf, will contain the textual representation of the number, myLong, in the given RADIX.

Cheers!