Roohansama 506 Posted March 5, 2019 Report Share Posted March 5, 2019 Hey guys,so im back with another simple question.i just want to know if there is a variable to declare both character and operation signs like " + , -"for example: " c+ ". i want to store "c+" in a variable for later use.. p.s: i know my explanation sucks Supra. likes this Quote Link to post Share on other sites
Acea 370 Posted March 5, 2019 Report Share Posted March 5, 2019 Well, you can store that in a simple var using std::string but what's the point? + Google is your friend for programming. All questions have been asked and answered. Roohansama likes this Quote http://nsa38.casimages.com/img/2016/06/14/16061405541885011.png Link to post Share on other sites
QuickBreakdown 1948 Posted March 5, 2019 Report Share Posted March 5, 2019 yes you can use std string #include <string> #include <iostream> void main() { std::string test = "hello from c++"; std::cout << test << std::endl; return 0; } endl is the end of line seperator depending on your platformstring is actually a class that contains many methods like size() and append(), check http://www.cplusplus.com/reference/string/string/?kw=string Roohansama likes this Quote Link to post Share on other sites
Roohansama 506 Posted March 7, 2019 Author Report Share Posted March 7, 2019 thanksi was using string in switch xD Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.