fork download
  1. #include <string>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. void Func(string * str){
  7. char a[100] = "ss";
  8. // ・・・
  9. /* char型の配列(a)の中の値を、引数のstring str にstring型に変換して、代入したい */
  10. (*str)=a;
  11. }
  12.  
  13. int main(void) {
  14. string test("failed");
  15. Func(&test);
  16. puts(test.c_str());
  17. return 0;
  18. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
ss