Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7890867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:28:07+00:00 2026-06-03T06:28:07+00:00

I am making a hangman program to practice my functions. This is my startup

  • 0

I am making a hangman program to practice my functions.
This is my startup to test a function.
For some reason he skips the function char guessing(char guess);
The only thing he puts on the screen is the “Welcome to Hangman 2.0” sentence and the “This is what you entered” sentence.
If you know what’s wrong could you please tell me also why it’s wrong.
Beceause I’am 15 and I like to learn things.

This is my code:

#include <iostream>
#include <string>
#include <ctime>
#include <cctype>
#include <vector>
#include <algorithm>

using namespace std;


char guess;

char guessing(char guess);
void check();

int main()
{
    cout <<"Welcome to Hangman 2.0. Enjoy, have fun and good luck!!\n\n";

    check();

    return 0;
}



char guessing(char guess)
{
    cout <<"Enter a guess: ";
    cin >> guess;

    return guess;
}

void check()
{
    char guessing(char guess);
    cout <<"This is what you entered: ";
    cout << guess;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:28:08+00:00Added an answer on June 3, 2026 at 6:28 am

    You are not calling your function correctly, try with:

    void check()
    {
        char ch = guessing();
        cout <<"This is what you entered: ";
        cout << ch;
    }
    

    and modify your guessing function like that:

    char guessing()
    {
        char guess;
        cout <<"Enter a guess: ";
        cin >> guess;
    
        return guess;
    }
    

    This way you don’t need a guess member variable and you don’t need to pass argument to your function.

    Aside from that, calling a function say char guessing(char guess); in C++ would be something like:

    char res = guessing('a');
    

    you don’t specifies return types or parameters types when calling a function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Making a small WCF test program which is based on a Store that has
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
While making some final tests of a class-library that I'm writing for Windows Mobile
Im making firefox extension. One function stores value in every tab, to use it
I'm making a simple command line Hangman game. void Hangman::printStatus() { cout << Lives
For practice, I'm trying to do some stuff in Python. I've decided to make
making a new jsp and got a mock-up from some analyst. Notice the sections
Im making slide show with jquery How i can set interval between two function
Making a ternary logic table, and I would like to make my own function
Making a footer for a web site I stumbled upon some strange behavior of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.