[Beginner] Call all functions from main() or jump to functions from within functions?

Context\
I have been learning C as a hobby since autum 2025 because I am intrigued by computers. I have mainly been using Bro Code’s tutorial and PDF The C Programming Language (Second Edition), although I’m too much of a beginner to understand all of the latter material. There’s not really much more to it. I don’t really have any concrete goals with learning C, but I thought it could be a good first step into the world of programming and for now, I just really enjoy coding. In the future, I’d like to learn assembly language and then finally (?) program some CPU.

Background\
When I realized how I can use for loops to go through strings and how I can then manipulate certain portions of said string, I realized that I can play around with it to allow a user to modify (here, “trim") any given text. Good fun!

In this particular case, I focused on practicing separating the program into as specific and small functions as possible.

Questions\
1) Should I or could I call the next function from within the previously called function, as opposed to listing them all in main() as I have done below? My guess is that listing them all in main() gives the reader a better overview of the flow, as opposed to having to look into each separate function to find out what’s connecting to what?

2) I believe that the only variable that really needs to be global is the “input”, since so many functions need to be able to access it. What are the pros and cons of using local variables where possible?

CODE #include <stdio.h> #include <string.h> //Function declarations void promptchoice_main(void); void promptchoice_main_again(void); void promptinput(void); void promptchoice_trim(void); void executechoice(char choice_trim); void trimnumbers(void); void trimwhitespace(void); void trimletters(void); void trimspecial(void); void specifyspecial(void); void printresult(char input[]); //Global variables char choice_main = 0x00; char choice_trim = 0x00; char choice_detail = 0x00; char choice_special = 0x00; char input[1000] = ""; char previous_input[1000] = ""; //Remove specific numbers, letters, punctuation or whitespace characters from input. int main() { printf("\nWelcome! This program trims text by removing unwanted characters.\n"); while (1) { if (strlen(previous_input) == 0) { // Check for previously trimmed text in memory. promptchoice_main(); if (choice_main == 'E') { break; } if (choice_main == 'T') { promptinput(); promptchoice_trim(); executechoice(choice_trim); printresult(input); } } else { promptchoice_main_again(); if (choice_main == 'E') { break; } if (choice_main == 'T') { promptinput(); promptchoice_trim(); executechoice(choice_trim); printresult(input); } else if (choice_main == 'P') { sprintf(input, "%s", previous_input); printf("\nYou are trimming previously trimmed text: %s\n", input); promptchoice_trim(); executechoice(choice_trim); printresult(input); } } } printf("\nGoodbye!\n"); return 0; } //Function definitions void promptchoice_main(void) { while (1) { printf("\nPress T and ENTER to trim text or E and ENTER to exit: "); scanf("%c", &choice_main); while (getchar() != '\n') {} if (choice_main == 'T' || choice_main == 'E') { break; } else { printf("\nInvalid input!\n"); } } return; } void promptchoice_main_again(void) { while (1) { printf("\nPress T and ENTER to trim new text, P and ENTER to trim previously trimmed text or E and ENTER to exit: "); scanf("%c", &choice_main); while (getchar() != '\n') {} if (choice_main == 'T' || choice_main == 'P' || choice_main == 'E') { break; } else { printf("\nInvalid input!\n"); } } return; } void promptinput(void) { printf("\nEnter the text that you would like to trim and press ENTER: "); fgets(input, sizeof input, stdin); input[strlen(input) - 1] = '\0'; return; } void promptchoice_trim(void) { while (1) { printf("\nWhat would you like to trim?\n1) Numbers (1, 2, 3...)\n2) Whitespace (space, tab or newline) \n3) Letters (A,B,C... a,b,c...)\n4) Special characters (!,?, . , ...)\nType one of the above numbers and press ENTER: "); scanf("%c", &choice_trim); while (getchar() != '\n') {} if (choice_trim >= 0x31 && choice_trim <= 0x34) { break; } // Only accept 1 through 4. else { printf("\nInvalid choice!\n"); } } return; } void executechoice(char choice_trim) { switch (choice_trim) { case 0x31: trimnumbers(); // 123 etc break; case 0x32: trimwhitespace(); // space, tab, newline break; case 0x33: trimletters(); // ABC..., abc... break; case 0x34: trimspecial(); // ! ? , . etc. break; } return; } void trimnumbers(void) { int n = 0; for (n = strlen(input) - 1; n >= 0; n--) { if (input[n] >= 0x30 && input[n] <= 0x39) { input[n] = 0x18; } } return; } void trimwhitespace(void) { while (1) { printf("\nType S to trim SPACE, T to trim TAB, N to trim NEWLINE or A to trim all whitespace: "); scanf("%c", &choice_detail); while (getchar() != '\n') {} if (choice_detail == 'S' || choice_detail == 'T' || choice_detail == 'A') { break; } else { printf("\nInvalid input!\n"); } } int n = 0; for (n = strlen(input) - 1; n >= 0; n--) { if (choice_detail == 'S') { if (input[n] == 0x20) { input[n] = 0x18; } } // space else if (choice_detail == 'T') { if (input[n] == 0x09) { input[n] = 0x18; } } // tab else if (choice_detail == 'N') { if (input[n] == 0x0A) { input[n] = 0x18; } } // newline else if (choice_detail == 'A') { if (input[n] == 0x20 || input[n] == 0x09 || input[n] == 0x0A) { input[n] = 0x18; } } } return; } void trimletters(void) { while (1) { printf("\nType U to trim uppercase letters, L to trim lowercase letters or A to trim all letters: "); scanf("%c", &choice_detail); while (getchar() != '\n') {} if (choice_detail == 'U' || choice_detail == 'L' || choice_detail == 'A') { break; } else { printf("\nInvalid input!\n"); } } int n = 0; for (n = strlen(input) - 1; n >= 0; n--) { if (choice_detail == 'U') { if (input[n] >= 0x41 && input[n] <= 0x5A) { input[n] = 0x18; } } // Uppercase else if (choice_detail == 'L') { if (input[n] >= 0x61 && input[n] <= 0x7A ) { input[n] = 0x18; } } // Lowercase else if (choice_detail == 'A') { if (input[n] >= 0x41 && input[n] <= 0x5A || input[n] >= 0x61 && input[n] <= 0x7A ) { input[n] = 0x18; } } } return; } void trimspecial(void) { while (1) { printf("\nType A to trim all special characters or S to specify which character to remove: "); scanf("%c", &choice_detail); while (getchar() != '\n') {} if (choice_detail == 'A' || choice_detail == 'S') { break; } else { printf("\nInvalid input!\n"); } } int n = 0; for (n = strlen(input) - 1; n >= 0; n--) { if (choice_detail == 'A') { if (input[n] >= 0x21 && input[n] <= 0x2F || input[n] >= 0x3A && input[n] <= 0x40 || input[n] >= 0x5B && input[n] <= 0x60 || input[n] >= 0x7B && input[n] <= 0x7E) { input[n] = 0x18; } } // All whitespace } if (choice_detail == 'S') { specifyspecial(); } // Let user specify character. return; } void specifyspecial(void) { while (1) { printf("\nEnter special character to trim and press ENTER: "); scanf("%c", &choice_special); while (getchar() != '\n') {} if (choice_special >= 0x21 && choice_special <= 0x2F || choice_special >= 0x3A && choice_special <= 0x40 || choice_special >= 0x5B && choice_special <= 0x60 || choice_special >= 0x7B && choice_special <= 0x7E) { break; } else { printf("\nNot a special character!\n"); } } int n = 0; for (n = strlen(input) - 1; n >= 0; n--) { if (input[n] == choice_special) { input[n] = 0x18; } } return; } void printresult(char input[]) { printf("\nTrimmed text:\n\n%s\n", input); sprintf(previous_input, "%s", input); // Save trimmed text for reuse. return; } //TODO //Create error handling when trimming non existing characters. //Replace characters (uppercase/lowercase, user selected, etc).
Learning session one: How to get used with polls on Mastodon. #poll #test #beginner #newbie #boost
Easy.
After getting some help.
Didn’t find the option.
What is a poll?
Poll ends at .

Well my first batch of pots came through the kiln mostly intact

One breakage because the statue thing fell over - sadly broke a thing my son made

I think it's a little under fired - but from what I can understand this isn't critical for a bisque fire.

Next stop - glazing!

#pottery #beginner

The Skill I Want to  Master: WordPress+Elementor& Blogging

If you could instantly master any skill, what would it be and why? If I could instantly master any skill, I would choose WordPress and content creation.  This year I started learning how websites work. A few months ago I had no idea about categories, tags, or how to publish a post. Now I am running my own blog and writing regularly.  I am still a beginner, but the learning process itself taught me consistency and problem-solving.  Mastering WordPress would help me share my ideas better […]

https://blog76297.wordpress.com/2026/06/18/the-skill-i-want-to-master-wordpresselementor-blogging/

The Skill I Want to  Master: WordPress+Elementor& Blogging

If you could instantly master any skill, what would it be and why? If I could instantly master any skill, I would choose WordPress and content creation.  This year I started learning how websites w…

WordPress Tips

Mistfall Hunter is FRANTICALLY FIXING its matchmaking, it was ruining games and streams 😤

The new beginner evaluation system took up to 4 hours, leaving experienced players stranded in empty lobbies. Devs are already speeding up the transition to the standard pool and lowering the difficulty to stabilize the online numbers. The fix is due within a day.

Beginner protection stays, skilled players joining them will still go into...

#SteamAndEpic #Beginner #FRANTICALLY #Mistfall #Hunter #FIXING

インフラしか分からん民がフロントエンドアプリを計測するためのエージェント導入手順をまとめてみた!やってみて!!
https://qiita.com/khara-nrkk/items/5f335b2769215f6a0300?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items

#qiita #Beginner #NewRelic #初心者 #初心者向け #observability

インフラしか分からん民がフロントエンドアプリを計測するためのエージェント導入手順をまとめてみた!やってみて!! - Qiita

Webページはどんどん複雑さがまして、純粋なhtmlページではなく、Reactなどを用いたケースが増えていて、アプリ内で一体何が起きているのか、ましてや千差万別なエンドユーザの環境から問題を解決するための適切な情報を得るのは簡単なことではないよね。情報取得のための技術的な手...

Qiita
Why Your Wi-Fi Drops So Often
https://www.allthethings.best/why-your-wi-fi-drops-so-often
Your Wi‑Fi drops mid-call, mid-stream, or mid-page-load even when the signal bar shows full because something is interfering with the airwaves, the channel is crowded, or your router is band-steering devices off the band that actually works. This post is about those intermittent disconnects — not slow speeds, and not dead zones in one specific room, which both need different fixes.
#features #beginner #networking #wifi
Maybe I'm getting in wood carving again. First time with non-power tools. Ill work on this later. Might have to pick up carving knives... #diy #whittling #sculpture #beginner #car #woodworking
Learning to draw: my first ever portrait from life. The art teacher said it was the best drawing I have done so far - very pleased with this. I started learning to draw from absolute scratch in January 2026. #ArtClass #Drawing #LifeDrawing #Beginner #MakersHour