Vaughn
Junior Member level 2
Normally we use "##" (token pasting operator) to concatenate the tokens in preprocessor directives like:
So my question is: Are there any method in C (especially in preprocessor directives) to extract just the letter "C" from "PC0" or trim the letter "P" and "0" (from code line 2nd) so that we could use it that letter in code line 1 to avoid the complication of Code line 3?
Code C - [expand] 1 2 3 #define SET_LOW(BIT) PORT(BIT ## _PORT) &= ~(1<<BIT) #define LED PC0 #define LED_PORT PORTC
So my question is: Are there any method in C (especially in preprocessor directives) to extract just the letter "C" from "PC0" or trim the letter "P" and "0" (from code line 2nd) so that we could use it that letter in code line 1 to avoid the complication of Code line 3?