Hi all, the search function failed to yield any results for me so I come here to create a new thread. I'm learning C++ on my own (sort of a weird hobby of mine to learn code, don't ask) and had an interesting question...
Consider the following:
Ingredients.h
#ifndef RECIPE_H
#define RECIPE_H
class Recipe
{
};
#endif
and...
Recipe Manager.cpp
#include "stdafx.h"
#include <iostream>
#include <string>
#include "Recipe.h"
int main()
{
}
inside of my main function in "Recipe Manager.cpp" would I somehow be able to accept a std::cin to create a new object of my Recipe class? For instance, would something like the following work:
string title = "";
std::cin >> title;
Recipe title;
I get that in line #3 above, a new object of Recipe will be instantiated with the name of "title", but what I'm looking for is a way for std::cin to create a new object of Recipe with the name of what the user types... is this possible?
Some background on me: pretty good at Java, learning C++ through "www.learncpp.com" currently at mid-chapter 8. Not in school yet, so you don't have to worry about me cheating on homework...
All help is appreciated, thank you.