Search:

Type: Posts; User: octangle

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,568

    Answer found... sorry to have trouble you...

    QUESTION
    How do I convert a constant passed to a #define macro into a text string?

    ANSWER
    Pass the parameter to a stringizing macro as shown below:

    #define NUMBER B85800 // this can be...
  2. Replies
    4
    Views
    1,568

    What you've offered will produce the following: ...

    What you've offered will produce the following:

    "X" (the name of the #define) not "ABC" (the value of the #define)...

    I want the value contained within X to be stringized
  3. Replies
    4
    Views
    1,568

    Quoting the contents of a #define

    I want to print the contents of a VC Preprocessor Definition (essentially a #define set by the IDE - such as X=ABC).

    When I do the following:

    printf("%s", X);

    I get the compiler error:
    ...
Results 1 to 3 of 3