So I'm fairly new to c++ and programming in general, so just for learning purposes, I am trying to extend the use of functions, but I'm not sure what do create for the arguments of my yesorno(). I created this and thought it would work, but as I understand, it always prints the return of '0' (which is also unwanted, but I understand why it does it currently) but does nothing with the variables and ends the program. Does anyone have anything that would spare me a remote crash course on everything I'm doing wrong?
#include <iostream>
int main()
{
int yesorno_input = NULL;
std::cout << yesorno();
if (yesorno_input == 1)
{
std::cout << "yes";
}
else
{
std::cout << "no";
}
std::cin.get();
}
int yesorno()
{
int yesorno_input = NULL;
char choice;
std::cout << "Y\\N";
std::cin >> choice;
if (choice == 'y')
int yesorno_input = 1;
else if (choice == 'n')
int yesorno_input = 0;
else
std::cout << "...";
std::cin.get();
return 0;
}