Help With Project.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maylea
    New Member
    • Jul 2007
    • 13

    Help With Project.

    Hello.
    Something wont work right in this code and I really need this code to work for my project.

    I need it so the " works with "set /p bytescode= bytes= "" How do I make my code work saying " as a word? Instead of it being a code I want it as a Word. >.<?

    Code:
    Code:
        system("set /p bytescode= bytes= "");
  • ravenspoint
    New Member
    • Jul 2007
    • 111

    #2
    I do not understand the question. However, I notice that you have an odd number of ". This is usually a bad idea. Perhaps you need to escape one of them, something like this:

    Code:
    system("set /p bytescode= bytes= \"");

    Comment

    • Maylea
      New Member
      • Jul 2007
      • 13

      #3
      I mean I want to say the word " << instead of it being " " Is there anyway of putting it in between them as a word?

      Comment

      • scruggsy
        New Member
        • Mar 2007
        • 147

        #4
        Originally posted by Maylea
        I mean I want to say the word " << instead of it being " " Is there anyway of putting it in between them as a word?
        Hmm, that didn't really clarify things. ;)
        If you want to include the quote character, ", in a string you need to escape it like ravenspoint said.
        For instance, to output the string George "The Decider" Bush, you'd do:
        Code:
        cout << "George \"The Decider\" Bush";
        \" gets converted to a quote character.
        Is that what you needed, or do you need to restate your question more clearly?

        Comment

        • Maylea
          New Member
          • Jul 2007
          • 13

          #5
          Well In Bat Format The code is like this.
          set /p bytescode= bytes="

          In c++ It should be like this
          system("set /p bytescode= bytes="");

          But It wont let me use "

          Hope this helps a little.

          Comment

          • ilikepython
            Recognized Expert Contributor
            • Feb 2007
            • 844

            #6
            Originally posted by Maylea
            Well In Bat Format The code is like this.
            set /p bytescode= bytes="

            In c++ It should be like this
            system("set /p bytescode= bytes="");

            But It wont let me use "

            Hope this helps a little.
            Yea, just like scruggsy said, you need to use an escape backslash:
            [code=cpp]
            system("set /p bytescode= bytes=\"");
            [/code]

            Comment

            • Maylea
              New Member
              • Jul 2007
              • 13

              #7
              Okay this helped me thank you

              Comment

              Working...