set_input_string(3)

πŸ“¦ version 1.6, in fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

set_input_string β€” bestie, it's the glow-up for your input prompts: it hands the user a pre-filled, editable default string before they even start typing. ✨


πŸ’… SYNOPSIS πŸ’…

#include <gstream.h>

void set_input_string(char const *s);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you're asking someone for input, but you don't want them staring at a blank void. Rude, honestly. set_input_string gives you a way to specify an editable default string when inputting. It shows up already typed out, cursor parked at the end, just waiting for vibes. 🌸

Lowkey consider the following example:

char buf[100];
gs << "What's your opinion about gstream?\n";

gs.set_input_string("I think it is incredible wonderful!");
gs.getline(buf, 100);

The user will see the following:

What's your opinion about gstream?
I think it is incredible wonderful!|

where the | represents the cursor. Iconic. And then they can edit the string, for example:

What's your opinion about gstream?
I think it is superior, fantastic and| wonderful!

which results in buf containing the string "I think it is superior, fantastic and wonderful!" β€” no cap, that's the whole thing. πŸ’–


This page is from the gstream manual, section 3, and it's documenting gstream version 1.6. That's the whole tea. 🫢 Thanks for reading bestie, go forth and make your input prompts cute! πŸ’…βœ¨

πŸ“¦ where this page comes from