I am trying to achieve that C interprets my string as macro.
Hey, let's suppose there is a defined macro as,
#define ABC 900
If i define;
char* s[] = "ABC" ;
then,
printf("%d",s) ;
Is there any way the compiler understands that "ABC" as macro ABC and passes 900 integer value to printf ?
#include<stdio.h>
#define abc 15
int main(void) {
char a[] = "abc" ;
printf("%d",a);
return 0;
}
When i try the above code, instead of my desired output 15 , i get 6487568 which i guess the integer equivalent of that string.
Edit : those were random values , or address of strings. ( as stated below by others )