Feat: SCANF WORKING!

This commit is contained in:
AfonsoCMSousa
2026-08-05 11:29:15 +01:00
parent ba81bb8e10
commit 7a4394feb6
4 changed files with 39 additions and 34 deletions
+8 -7
View File
@@ -33,14 +33,15 @@ void kmain(void) {
// TODO: Enable user input handling
char input_buffer[256] = {0};
gets(input_buffer, sizeof(input_buffer));
printf("Input buffer contents in hex:\n");
for (int i = 0; input_buffer[i] != '\0'; i++) {
printf("[%x]", (unsigned char)input_buffer[i]);
}
printf("\nYou entered: %s\n", input_buffer);
scanf("%s", input_buffer);
printf("You entered: %s\n", input_buffer);
int num1, num2;
printf("Enter num1: ");
scanf("%d", &num1);
printf("Enter num2: ");
scanf("%d", &num2);
printf("You entered: %d and %d\n", num1, num2);
// Infinite loop
while (1) {
__asm__ volatile("hlt");