Rather than incrementing p by 1 for each iteration how would I go about incrementing p by 2 each time...thanks for your help. for(int p = 0; p < total_words; p++)
Rather than incrementing p by 1 for each iteration how would I go about incrementing p by 2 each time...thanks for your help. for(int p = 0; p < total_words; p++)
p+=2 is the same thing as p = p + 2Code:(int p = 0; p < total_words; p+=2)
the best things in life are simple.
Also, not in response to your original question, you can do other things with for loops, such as:
Code:x = 12; // or some arbitruary value for( int i = 0; i < 10; i++, x++ ) { // Code... }