ItsMods

Full Version: error on compiling this code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
i use this code to bind F keys ( Bind hotkey) .
guys i have error on compiling this code
pleas help me what is problem?

C++ Code
  1. void ExecHotkey(int vKey)
  2. {
  3. char connect_cmd[255];
  4. if (vKey == VK_F1)
  5. {
  6. //Console(0, V("connect_ext\n"));
  7. sprintf(connect_cmd, V("connect %s:%d\n"), 192.168.137.2, 27016);
  8. }
  9. }


Error:
error C2143: syntax error : missing ')' before 'constant

Thank you
(10-12-2012, 11:18)raminr63 Wrote: [ -> ]Hi
i use this code to bind F keys ( Bind hotkey) .
guys i have error on compiling this code
pleas help me what is problem?

C++ Code
  1. void ExecHotkey(int vKey)
  2. {
  3. char connect_cmd[255];
  4. if (vKey == VK_F1)
  5. {
  6. //Console(0, V("connect_ext\n"));
  7. sprintf(connect_cmd, V("connect %s:%d\n"), 192.168.137.2, 27016);
  8. }
  9. }


Error:
error C2143: syntax error : missing ')' before 'constant

Thank you

Ip should be given as a String "192.168.137.2" It tried to parse that number to 192 comma 168 comma 137 comma 2 -> Nope.avi