fork download
  1. int main( int argc, char *argv[] )
  2. {
  3.  
  4. int P=2;
  5.  
  6. do
  7. {
  8. walk();
  9.  
  10. }while(P==2);
  11.  
  12. }
  13.  
  14. void walk(void)
  15. {
  16. AL::ALMotionProxy motion("127.0.0.1", 9559);//連線和宣告,主要問題點,因為在迴圈內,不斷地連線,造成記憶體飆高
  17.  
  18. double fractionMaxSpeed=0.2;
  19.  
  20. AL::ALValue names = AL::ALValue::array("LHipPitch");
  21.  
  22. AL::ALValue angles = AL::ALValue::array(-0.4);
  23.  
  24. motion.setAngles(names, angles, fractionMaxSpeed);
  25.  
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:8:18: error: ‘walk’ was not declared in this scope
prog.cpp: In function ‘void walk()’:
prog.cpp:16:9: error: ‘AL’ has not been declared
prog.cpp:16:27: error: expected ‘;’ before ‘motion’
prog.cpp:20:9: error: ‘AL’ has not been declared
prog.cpp:20:21: error: expected ‘;’ before ‘names’
prog.cpp:22:9: error: ‘AL’ has not been declared
prog.cpp:22:21: error: expected ‘;’ before ‘angles’
prog.cpp:24:9: error: ‘motion’ was not declared in this scope
prog.cpp:24:26: error: ‘names’ was not declared in this scope
prog.cpp:24:33: error: ‘angles’ was not declared in this scope
stdout
Standard output is empty