Re: How to define a string with spaces on compile line?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Hilarion" <hilarion@xxxxxxxxxxxxxxxxx> wrote in message
news:diot7i$25g$1@xxxxxxxxxxxxxxx
>> I'd like to pass in a string on the command line to be used in the
>> compiled
>> program. I've done this many times by adding to the compile line as:
>>
>> /D SYMBOLTODEFINE=\"value\"
>>
>> This is now the first time that the string needs to include a blank. I've
>> tried to simply enter the space and to escape it with a backslash but in
>> neither case does the compiler like it. What is the correct way to do
>> this?
>
>
> Maybe like that:
>
> /D "SYMBOLTODEFINE=\" value \""
>
> What compiler? What platform?
>
>
> Hilarion


I don't think you understood the problem. As I said, I tried to just enter
the space (which is what your example does and I get an error on it. I also
tried to escape it (entering the backslash followed by the blank and still
got an error.

This is with Visual Studio 6.


.



Relevant Pages

  • Re: Unrecognized escape sequences in string literals
    ... need worry that I've misinterpreted what a string literal means. ... You can't expect the compiler to save you from ... Adding escape codes into the string literal doesn't ... (This behavior is useful when debugging: if an escape sequence is ...
    (comp.lang.python)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... Big-O notation isn't mathematics per se, it's computer science notation ... "length of the string". ... outrun something compiled and optimized by a good C compiler. ... > either general computing culture or culture outside computing. ...
    (comp.programming)
  • Re: [EGN] Hoisting Loop Invariants (Was: Re: [EGN] Numerical Accuracy)
    ... compiler out there somewhere that did as you claim. ... > the programmer has this knowledge, then the programmer should not use ... >> string in a loop, regardless of the blatant inefficiency of doing so. ...
    (comp.programming)
  • Re: How to convert Infix notation to postfix notation
    ... and make all strings const save where the intent ... function whose contract is to change the string. ... the compiler "just" prevents the string ... try to do using the pointer you get. ...
    (comp.lang.c)
  • Re: PL/I string representations
    ... >> of the language, so it was interesting to me, hopefully it will be to ... I found a workable compiler for Fortran in 1971 (with a bug ... >> The specified length is the minimum, and each time a character ... >> string is assigned to E, the length is stored with it. ...
    (comp.programming)