[cc65] cc65 and BASIC GET?

From: Raj Wurttemberg <rajw1c64.us>
Date: 2005-09-26 23:21:43
 
I'm making a simple menu in my program to get a single key and I would like
to make sure I am using C properly to emulate the BASIC GET statement.

[Note: I'm learning C as I write this program]

I read about the "getchar()" statement (macro?) and saw that it wasn't ANSI
C so I was not surprised to see that it was not in cc65 and I don't know
enough about macros yet. Going through the sample programs included with
cc65 I found "cgetc (void)" used in hello.c to get a key. It works, but is
this the proper way to use it?

	unsigned char menusel;
	fflush (stdout);
	menusel = cgetc();

	// Debug output
	printf("key pressed: %c", menusel);

Thanks,
/*Raj*/

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Sep 26 23:24:14 2005

This archive was generated by hypermail 2.1.8 : 2005-09-26 23:24:17 CEST