C++ Programming Tutorial 43 - Creating a Menu

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

This is so good.
I'm doing an assignment right now, and this is exactly what I've been searching for all day.

UCkFvZiCmKQUOsWpJTDg
Автор

You saved my college with this. I was feeling overwhelmed and didn't understand how to make a menu for some reason. You seriously just helped me out so much. Thank you for this video.

askjake
Автор

Keep it up, some people really enjoy how many episodes you post

joelt
Автор

It's funny because professors just say make a menu and it's so easy. I didn't have a very good idea of what they were talking about, just knew I had to use a switch. Ty bro

FM
Автор

You really made my day, thanks man. Keep on with your good work

michealdosty
Автор

you explained this so much better and in more detail than my professor did! thank you !!!

ThaColonel
Автор

Men, u really went all-out on this tutorial! Thanks again so much for making it.

PunmasterSTP
Автор

Why does everyone start their main function to return a int? Like don't be the same as everyone else, why not start off with a class Main() with a void main() and make it describe something.

REktSigMa
Автор

I think the choice==0 condition will never be reached because of the return 0; in case of 0, so it might as well be a while(true) or a do...while(true) or you have to remove the return 0;

PeterVanHertum
Автор

What's the point of using a do while loop here? You can just a while(true) and it will do the same thing. You are returning when the choice is 0 anyways so there's no point in using choice != 0.

#include <iostream>
#include <string>

int main()
{
srand(time(NULL));



int choice = 0;



while (true)
{
std::cout << "1. Play Game" << std::endl
<< "2. Quit" << std::endl
<< "Input: ";
std::cin >> choice;


std::cout << std::endl;



switch (choice)
{
case 1:
game();
break;



case 2:
std::cout << "Thank you for playing" << std::endl
<< std::endl;
return 0;


default:
std::cout << "Error: Invalid Input" << std::endl
<< std::endl;
break;
}
}

return 0;
}

Pranav
Автор

So, how do I put the game in this code?

MineCraft-sbzz
Автор

Question... how much this will slow down the code if after ":" inside CASE statement I use scope brackets. Example: case 1: {insideFunction1 (); insideFunction2 (); insideFunction3 (); break;}... will this necessary addition significantly affect the code??

laureven
Автор

I am new to c++ but the one thing i noticed is you use the std:: before cin, cout and the older videos other people use do not. Is that something new in the newer versions of c++.

mod
Автор

Hey!! Could you send me a link to a website which gives me the function of symbols used in pairs like !=, ==, etc.

tridipbarman
Автор

I love the tutorial but do we need an else statement if the input is 2, 3... because in that case the game is going to run the same way as typing 1 as an input

ylllatifaj
Автор

do you have a video on this for C programming?

alexxlucero_
Автор

Could you please tell me what's the name of this Visual Studio Code Theme? Thank you so much.

vicyoslinuxofficial
Автор

when I hit enter the console window closes. How do I do multiple inputs?

dylan
Автор

can u teach me how to make a Install menu and a Graph in c++ 3D graph's and like a gameengine

FrostGamingHype
Автор

I've been learning C++ for a while now. I'm a full stack JavaScript developer by trade but I'm working to be well rounded.

First off, I've yet to see anything other than a console application. I switched from Windows to Mac OS when the M1 Macs came out. Visual studio on Mac OS doesn't support C++ development and I'm not going to waste my time learning xcode because I don't plan on using it for anything else. At least Visual Studio on Windows has visual C++ as an option.

So where do we go from there? When and how do we start building guis?

bobDotJS
join shbcf.ru