Advertisement
micclly

test-build600.mq4

Feb 17th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. // for build 600 or later
  2.  
  3. // #property strict
  4.  
  5. // #property strict なしでは arrays passed by reference only の警告
  6. // #property strict ありでは arrays passed by reference only のエラー
  7. // 警告/エラー回避のためには void func(string& strArray[]) と参照形式にする
  8. void func(string strArray[]) {
  9.     for (int i = 0; i < ArraySize(strArray); i++) {
  10.         Print(strArray[i]);
  11.     }
  12. }
  13.  
  14. void OnStart()
  15. {
  16.    
  17.     // #property strict なしでは警告なし
  18.     // #property strict ありでは implicit conversion from 'number' to 'string' の警告
  19.     // 警告回避のためには string(1) または IntegerToString(1) とするか、
  20.     // StringConcatenate を使う
  21.     string s = "a" + 1;
  22.  
  23.     string strArray[] = { "aa", "bb", "cc" };
  24.     func(strArray);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement