The following C++ program does not compile

  • Context: C/C++ 
  • Thread starter Thread starter soul5
  • Start date Start date
  • Tags Tags
    C++ Program
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
soul5
Messages
63
Reaction score
0
count << "2 + 3 * 5 = " 2+3*5 << endl;


do I just need to put it as

count << "2 + 3 * 5=" << (2+3*5) << endl;
 
Physics news on Phys.org
soul5 said:
count << "2 + 3 * 5 = " 2+3*5 << endl;do I just need to put it as

count << "2 + 3 * 5=" << (2+3*5) << endl;

First one is bad, second one looks good.

Why don't you simply compile the second, run and test it? ooO, does the second one also throws error?