fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void my_print(char *a, string &b)
  5. {
  6. b = a;
  7. cout << b.size() << endl;
  8. cout << b.length() << endl;
  9. }
  10.  
  11. int main() {
  12. // your code goes here
  13. string b;
  14.  
  15. char a[10] = "HELLO\n";
  16. b = a;
  17.  
  18. cout << sizeof(a) << endl;
  19. cout << b.size() << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
10
6