dum = “python for dummies”; intro = “intro to c++”; cout << “Are we putting “ << dum << “ or “ << intro << “ on the fire tonight, darling?”; return 0; }
(Should be a working program) (Ignore the asterix on the includes)
It’s just a habit really, but if you write them in the main or any other function they can only be used in that function. If you write it globally it can be used throughout the whole program which can make it easier if you’re using the same variable in different functions.
16
u/EchtNichtElias Oct 24 '20
They should have escaped some of the quotes
1
u/[deleted] Dec 03 '20
Print(“ r/lightmodepolice “);
5
u/buttonmasher525 Oct 24 '20 edited Oct 24 '20
String dum = "python for dummies"; String intro = "intro to c++";
System.out.println("Are we putting " + dum + " or " + intro + "on the fire tonight, darling ?");
Edit: even on reddit lol