I have the following problem: I pass a string to a function, however, when it receives the string, it receives a null value and does nothing, I've been trying to solve it for days and nothing, I'm thinking it's a error in main() function
Here is my code:
void main(){
clear_screen();
print_string("Hello World!");
}
void print_string(const char *string){
int offset = get_cursor();
int i = 0;
while (string[i] != 0) {
if(offset >= ROWS * COLS * 2) {
offset = scroll_line(offset);
}
if(string[i] == '\n') {
offset = move_offset_to_new_line(offset);
}else{
print_char(string[i], offset);
offset += 2;
}
i++;
}
set_cursor(offset);
}
What can be happening in my code? Note: I'm following the example on this site: https://dev.to/frosnerd/writing-my-own-boot-loader-3mld