Others have posted since I started writing this, but I'll post since I had a few details that the others didn't include.
As has been stated, I'm not sure how there aren't syntax errors.
You have many capitalization errors in your post (maybe it was a poor transcription?). For example, you have pwm when it should be PWM. This brings up the question of why you're using PWM directly and not going through the Victor or Jaguar class?
Your function prototype of update_drive should be giving you an error. You have
when it needs to be
Code:
void update_drive(void);
The way you're trying to access class members is incorrect and should be giving you an error. You have
when it should be
And what's with this line? The compiler would most definitely complain about that
Code:
int k = /*your value here*/; //speed increase/decrease value
In summary, the code that you posted should not compile. Double check that you're not getting errors.