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.
Is that the whole file as it appears? I'm guessing not, seeing as there's not even 17 lines there. I'd also guess that line 17 is the "void printstr(char string[])" but I may be wrong. IIRC you can't pass variable length arrays in C/C++, but I've always used the fact that (code wise) pointers and arrays are practically interchangeable, so I may be wrong. I would have used "void printstr(char *string)" instead. The function itself would be the same.
This is an error. The comma operator has a different function then the use of the semicolon which is used to end expressions. Thus you need to use semicolons not colons. (This is basic C...)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Firestryke31 wrote:I've been staring at ASM for too long...
That's how I feel every time I look at C and find bazillions of things I think are wrong in the code.
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Okay, you should so seriously not write an OS. You can't write code, you can't debug code. You just failed the required knowledge test.
Go start with the basics and see you again in a year (at the least!)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]