I am currently attempting to program an LCD screen to control a series of lights.
As a part of this I have implemented a page for the user to select some variables or settings.
I have written an array of which the user can increment a variable and the position of the array will change.
I require to add some leading 0s to the array however it doesn't seem to accept this?
I have no idea what you mean by "adding leading zeros to an array". What type of array? What code? Arrays always start completely full of zeros. You can make any element you want a zero. You can even use memcpy to make a bunch of them zero all at once.
it removes the leading 0 when I try to print it to the LCD
No it is the print statement that removes the leading zeros, there is no need to add them to an array it simply does not change what is in the array in the first place.
Grumpy_Mike:
No it is the print statement that removes the leading zeros, there is no need to add them to an array it simply does not change what is in the array in the first place.
Except when you write it out in your code that way, then it gets treated as octal and doesn’t have the value you thought it did.