how can i give the user a choice in my code C++

+1 vote
asked Mar 29 by marc23 (130 points)
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int main()
    char name[50];
    cout << "What is your name, wanderer?" << endl;
    cin.getline(name, 50);
    cout << "You better move fast, " << name << ". The ghouls are attacking the town." << endl;
    cout << "\n----------------------Press any key to continue----------------------" << endl;

1 Answer

0 votes
answered Mar 30 by Bambofy (480 points)
What do you mean by give the user a choice? you are already giving the user a choice by asking them what their name is
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.