fork download
  1.  
  2. for (int i = 0; i < encodedmessage.size(); )
  3. {
  4.  
  5. if (i + 7 < encodedmessage.size())
  6. {
  7.  
  8.  
  9. string temp = encodedmessage.substr(i, 8);
  10. bitset<8>bits(temp);
  11. unsigned char c = bits.to_ulong();
  12. charmessage += c;
  13. i += 8;
  14. }
  15. else if(i<encodedmessage.size())
  16. {
  17. int ba2y = encodedmessage.size() - i;
  18. string temp = "";
  19. int cur = 8 - ba2y;
  20. for (int j = 0; j < cur; ++j)temp += "0";
  21. bitset<8>bits(temp+encodedmessage.substr(i,encodedmessage.size()-i+1));
  22. unsigned char c = bits.to_ulong();
  23. charmessage += c;
  24. break;
  25. }
  26.  
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:3: error: expected unqualified-id before ‘for’
   for (int i = 0; i < encodedmessage.size(); )
   ^~~
prog.cpp:2:19: error: ‘i’ does not name a type
   for (int i = 0; i < encodedmessage.size(); )
                   ^
prog.cpp:2:46: error: expected unqualified-id before ‘)’ token
   for (int i = 0; i < encodedmessage.size(); )
                                              ^
stdout
Standard output is empty