Skip to main content
deleted 13 characters in body
Source Link
Chris Martin
  • 30.9k
  • 12
  • 83
  • 142

how How to compare stringstrings in C conditional preprocessor-directives

iI have to do something like this in C but it. It works only if I use a char, but I need a string how. How can I do this?

#define USER "jack" // jack or queen #if USER == "jack" #define USER_VS "queen" #elif USER == "queen" #define USER_VS "jack" #endif 

thanks to all!

how to compare string in C conditional preprocessor-directives

i have to do something like this in C but it works only if I use a char but I need a string how can I do?

#define USER "jack" // jack or queen #if USER == "jack" #define USER_VS "queen" #elif USER == "queen" #define USER_VS "jack" #endif 

thanks to all!

How to compare strings in C conditional preprocessor-directives

I have to do something like this in C. It works only if I use a char, but I need a string. How can I do this?

#define USER "jack" // jack or queen #if USER == "jack" #define USER_VS "queen" #elif USER == "queen" #define USER_VS "jack" #endif 
Source Link
frx08
  • 4.4k
  • 8
  • 39
  • 46

how to compare string in C conditional preprocessor-directives

i have to do something like this in C but it works only if I use a char but I need a string how can I do?

#define USER "jack" // jack or queen #if USER == "jack" #define USER_VS "queen" #elif USER == "queen" #define USER_VS "jack" #endif 

thanks to all!