fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. return 0;
  7. }
  8. bool GetXXXXXX(char *_strUA, char *_strID, char *_strDer, char *_strDest)
  9. {
  10. bool blnRet = true;
  11. char *strUID;
  12. size_t sizeRet = 0;
  13. wchar_t* wc;
  14. String^ strTemp;
  15.  
  16. if (strlen(_strID) <= 0)
  17. {
  18. // 識別文字が空の場合、処理を終了
  19. return false;
  20. }
  21.  
  22. size_t length = strlen(_strDer);
  23. wc = new wchar_t[length + 1];
  24. mbstowcs_s(&sizeRet, wc, length + 1, _strDer, length + 1);
  25.  
  26. String^ strUA = gcnew String(_strUA);
  27. array<String^> ^split = strUA->Split(*wc);
  28. IEnumerator^ myEnum = split->GetEnumerator();
  29. String^ strID = gcnew String(_strID);
  30. Regex^ _regID = gcnew Regex(strID, RegexOptions::IgnoreCase | RegexOptions::Singleline);
  31. while (myEnum->MoveNext())
  32. {
  33. String^ s = safe_cast<String^>(myEnum->Current);
  34. Match^ m = _regID->Match(s);
  35. if (m->Success)
  36. {
  37. s = s->Replace('(', ' '); // 不要文字『(』の削除
  38. s = s->Replace(')', ' '); // 不要文字『)』の削除
  39. strUID = (char *)(void *)Marshal::StringToHGlobalAnsi(s->Trim());
  40. strTemp = gcnew String(strUID);
  41. strcat_s(_strDest, STR_BUFF_SIZE, strUID + strlen(_strID) + m->Index);
  42. strTemp = gcnew String(_strDest);
  43.  
  44. break;
  45. }
  46. }
  47.  
  48. return blnRet;
  49. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'bool GetXXXXXX(char*, char*, char*, char*)':
prog.cpp:14: error: 'String' was not declared in this scope
prog.cpp:14: error: 'strTemp' was not declared in this scope
prog.cpp:16: error: 'strlen' was not declared in this scope
prog.cpp:22: error: 'strlen' was not declared in this scope
prog.cpp:24: error: 'mbstowcs_s' was not declared in this scope
prog.cpp:26: error: 'strUA' was not declared in this scope
prog.cpp:26: error: 'gcnew' was not declared in this scope
prog.cpp:26: error: expected `;' before 'String'
prog.cpp:27: error: 'array' was not declared in this scope
prog.cpp:27: error: expected primary-expression before '>' token
prog.cpp:27: error: expected primary-expression before '^' token
prog.cpp:27: error: 'split' was not declared in this scope
prog.cpp:28: error: 'IEnumerator' was not declared in this scope
prog.cpp:28: error: 'myEnum' was not declared in this scope
prog.cpp:29: error: 'strID' was not declared in this scope
prog.cpp:29: error: expected `;' before 'String'
prog.cpp:30: error: 'Regex' was not declared in this scope
prog.cpp:30: error: '_regID' was not declared in this scope
prog.cpp:30: error: expected `;' before 'Regex'
prog.cpp:33: error: 's' was not declared in this scope
prog.cpp:33: error: 'safe_cast' was not declared in this scope
prog.cpp:33: error: expected primary-expression before '>' token
prog.cpp:34: error: 'Match' was not declared in this scope
prog.cpp:34: error: 'm' was not declared in this scope
prog.cpp:39: error: 'Marshal' was not declared in this scope
prog.cpp:39: error: expected `;' before '::' token
prog.cpp:40: error: expected `;' before 'String'
prog.cpp:41: error: 'STR_BUFF_SIZE' was not declared in this scope
prog.cpp:41: error: 'strcat_s' was not declared in this scope
prog.cpp:42: error: expected `;' before 'String'
stdout
Standard output is empty