0

I realize that kprint takes a pointer as a parameter. I don't understand how it loops through each character when you do something like kprint("HELLO WORLD"); Can you really just increment *s to get to the next char like:

s++;
char c = *s;

4
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

hi
it is so simple

see the code below. I am not whether the orginal code is like this. But may be it is similier to the following code.

kprint(char * s){
    char *str=s; 
    while(*str!='\0'){
         putc(*str);
         str++; 
    }
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.