When I run this program on my calculator:
void main(void) {
char *quot = malloc(10 * sizeof(char));
char *rest = malloc(10 * sizeof(char));
sprintf(quot, "%d", 5);
printText(quot, 0, 0);
sprintf(rest, "%f", 2.03);
printText(rest, 0, 1);
}
printText
function for my TI 84 CE calculator:
void printText(const char *text, uint8_t xpos, uint8_t ypos) {
os_SetCursorPos(ypos, xpos);
os_PutStrFull(text);
}
This is the output on my calculator's LCD:
5
%
There is a percentage token instead of 2.03
, what is the reason behind this?
I have included these libraries:
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tice.h> // this is for my TI84