#define OK 1
here fun() returns char * and stored in ptr. i would like to check weather ptr is OK or not, i do't like to use strcmp() since, i would like do strcmp() for 100 message. But i would like to check weather its in #define or not. how to do? please help me.
>i think u did't understand my problem
I understood your problem to be nonsensical and impossible with the given restrictions. My previous post gave you the answer you needed rather than the one you wanted.
>how to compare the string with #define...
#define a string literal and use strcmp, the macro symbol itself is lost after compilation, so you can't use it at runtime:
#define OK "OK"
char *ptr = fun();
if (strcmp(ptr, OK) == 0)
Oh wait, you don't want to use strcmp. I guess you're SOL. :icon_rolleyes:
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...