does anyone know why this old* notebook is like, alternating blank yellow pages & grid paper?

I feel like it has something to do with copy paper or something, to make copies? But it doesn't seem to copy my pen (though I have to admit I have only used copy paper like once when I was younger so I'm not sure how it's supposed to work)

*It's like 1980s, according to the date written on one of the pages inside.

code (please help) 

so I haven't really done much c coding

in Python if I wanted to have functions which returns a string, I'd do something like

def short_to_long_name(shortname)
if shortname == "a": return "Alphabet"
elif shortname == "b": return "Banana"

in C I would????

I think you can return char* but I also think there's something bad about that to do with memory or somesuch? e.g. (apologies for inline ifs)

char* short_to_long(char shortname) {
if (shortname == 'a') return "Alphabet"
else if (shortname == 'b') return "Banana"

(I don't even know whether that works? whether that *should* work)

but I also think you can do something like

void short_to_long(char shortname, char* output) {
if (shortname == 'a') strcpy(output, "Alphabet")
else if (shortname == 'b') strcpy(output, "Banana")

but then you also can do something like

void short_to_long(char shortname, char[] output)


void short_to_long(char shortname, char[MAX_SIZE] output)

and I don't really know what the difference is between them (in terms of, which should I use & why, or what exactly each what does (if they work at all))

I looked at some wikibooks definitions of strcpy and it seems to be like, const char* which I haven't been taught at this course yet (and you're __not__ allowed to use features you haven't been taught, because idfk) [yes this was kinda taughtish but I don't think the lecturer understood my questions] and I don't know what that difference is


Welcome to thundertoot! A Mastodon Instance for 'straya