I just started learning C, so please bear with my if my code is not all that great! So I am basically trying to print out "Start Typing >" utilizing lc4_puts(). Then I am trying to fall into a loop where it waits for me to type a character and then prints that character to the console. The program terminates when it encounters a line feed character char '/n'.So this is my code..
Code:
#include "os_trap_wrappers.h"
#define STRING_SIZE 100
int main(void)
{
char c, input[STRING_SIZE];
int i;
lc4_puts("Start Typing >");
for (i = 0; (c = lc4_getc()) != '\n'; ++i) {
input[i] = c;
}
input[i] = '\0';
lc4_putc(input[i]);
return 0;
}
and this is what is contained in my wrappers file
Code:
char lc4_getc();
void lc4_putc(char c);
void lc4_puts(char *str);
void lc4_draw_box(int x, int y, int size, int *colors);
although my program compiles and my simulator displays start typing to the screen, i can't type after it. i don't know what could be wrong with my code! any guidance would help, thanks!