[cc65] cc65/C questions

From: Tom Watt <tom1awhost.biz>
Date: 2006-09-07 18:00:17
Hello,

 

I am working on a project with cc65 and I am both learning cc65 and
re-learning C at the same time and have some questions.  Maybe someone has
some code examples or can point me to some functions that will help?

 

1. Is there a function that will separate a string into an array of strings
based on spaces?

 

Example:  Starting string: "one two three"   is converted into "one" in
element 0, "two" in element 1, "three" in element 2

 

2. I'm using the following function to get text at a prompt.  It works fine
except if you backspace too much the cursor keeps going and will go up to
the next line.  Is there an easy way to fix that?

 

char* getline(void)

{

            static char linetext[40];

            unsigned len;

            fgets(linetext, sizeof(linetext), stdin);

            len = strlen(linetext);

            if (len >= 1 && linetext[len - 1] == '\n') linetext[len - 1] =
'\0';

            return linetext;

}

 

3. Is there an existing cc65 source for a full screen Commodore SEQ file
editor that I can freely (public domain) use to include in my program?

 

Thanks,

 

Tom



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Sep 8 14:22:19 2006

This archive was generated by hypermail 2.1.8 : 2006-09-08 14:22:23 CEST