Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
However, you've been such a pain in the backside in the last few days that I don't feel inclined to look at your problem
Hmm.. somebody got out of bed with the wrong foot.
but then again people who write *string++; instead of string++; for advancing the pointer only should learn a little more about the language they are writing in.
char getch() {
//- code for getting a single character:
//- the problem will be in this function.
}
void gets(char * line) {
char ch;
while((ch = getch()) != '\n') *line++ = ch;
}
Last edited by os64dev on Fri Sep 28, 2007 1:55 am, edited 1 time in total.
os64dev wrote:but then again people who write *string++; instead of string++; for advancing the pointer only should learn a little more about the language they are writing in.
It's valid - the postfix '++' occurs after the dereferencing and the data is assigned.
i didn't talk about your code *string++ = scancode; is valid and is also how i would use it. i meant the code of mohammed who wrote *string++; just to advance the string see
- and try and work out why your string will contain nothing but a null-terminator when your function returns
I really think your C coding skills aren't up to scratch. Maybe you should try programming something simpler before an OS, because I for one will not help you with such trivial problems.