CabaretVoltaire Posted February 4, 2004 Share Posted February 4, 2004 Does CC65 support pointers? I have a line: int (*opcodes[17])(unsigned *); Which works in compilers for other platforms fine but gives me a syntax error in CC65. Also having data types for function arguement returns a syntax error too. Eg: int function(int *variable) or int function(int variable) errors but: function(variable) works Am I using an outdated version of the compiler or is it really this limited? Thanks Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted February 4, 2004 Share Posted February 4, 2004 I can't answer your questions but I can tell you that there is a mailing list for questions like this and Ullrich himself can answer them for you. As far as I'm concerned, these guys know their stuff inside and out. http://www.cc65.org/ Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted February 4, 2004 Share Posted February 4, 2004 Oh, I just read your other message in this base... the version of cc65 you are using is not support by Ullrich von Bassewitz or http://www.cc65.org/ since it is a special port of an old version specifically for lynx development. I also think that it only supports K&R syntax, not ANSI syntax. There are some projects in the works to get a lynx library going for the supported, cross platform CC65 from cc65.org. I started one, but got sidetracked... besides their are smarter men than me working on it already. HTH. Quote Link to comment Share on other sites More sharing options...
CabaretVoltaire Posted February 4, 2004 Author Share Posted February 4, 2004 I've messed around with it a bit and looked through some of the examples to get a feel of the syntax and have got around the problem: //create a function int return_a_number(number) int number; { return number; } //create an array of function pointers int (*func_ptr[1])(number); //set a pointer like: func_ptr[0] = (int (*)())return_a_number; //call the function like: an_integer = (*func_ptr[0])(5); Seems to work fine Thanks for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.