strlen in expressions
hi i am trying to make a program do this basically...
int * strlen / strlen * strlen * strlen = an int
i cannot figure out how to write that in code...
i don't know if you cannot use strlen in a "formula" ? or what?
(5000 * 8) / (5 * 8 * 8)
obviously using varibles in the program
Or something to that effect.
int main( void )
// USING *STRINGS
// Intitalise the *strings
// USING STD::STRING
// Initalise the std::strings
std::cout<< (5000 * one.size()) / (two.size() * three.size() * four.size());
Try: x = (a*b)/(c*d*e);
= is for assignment, you can't assign a value to a mathematical calculation, that's why x that gets the value is on the left.
Also use brackets to make the statement non-ambigous.
justforthis1, in the future could you make your titles a little more informative, for example "strlen in a formula" rather than "dumb newb question".
ok thanks, that helps a lot, it works now anyways
sorry about the title, i will do better next time