Re: [cc65] Input string routine for a line of data?

From: Joseph Rose <rose.joseph121yahoo.com>
Date: 2011-06-06 15:23:34
gets() will work, right?  I think I tried that.  As for the quickest method, I meant the one which requires the least code and effort.  Thank you.


From: "silverdr1wfmh.org.pl" <silverdr1wfmh.org.pl>
To: cc651musoftware.de
Sent: Monday, June 6, 2011 5:13 AM
Subject: Re: [cc65] Input string routine for a line of data?


On 2011-06-05, at 20:59, Joseph Rose wrote:

> Under cc65, what is the fastest way

Fastest in what terms? Fastest input? Even on 8bit machines it is usually limited only by user's speed of typing. Fastest development? Google for "string input in c", etc..

> to get a string of input from the user?

Might it be the same as under any standard C implementation...

>  I just need a quick-and-dirty approach for experimentation.  I am working mainly for the C64 but may work fopr other targets as well.

... especially if you want it to work with different targets?

An example to save you googling effort...

#include <stdio.h>

int main()
{
  char text[20];
  fputs("enter some text: ", stdout);
  fflush(stdout); /* http://c-faq.com/stdio/fflush.html */
  fgets(text, sizeof text, stdin);
  printf("text = \"%s\"\n", text);
  return 0;
}

-- 
SD!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo1musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
----------------------------------------------------------------------
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 Jun 6 15:23:55 2011

This archive was generated by hypermail 2.1.8 : 2011-06-06 15:23:58 CEST