Reversing String Data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nholdzkie
    New Member
    • Aug 2007
    • 10

    Reversing String Data

    how to make a program that will reverse the inputed data in output??? ex. the inputed data is blue the output should be eulb
  • nholdzkie
    New Member
    • Aug 2007
    • 10

    #2
    the program using C++ please help me..

    Comment

    • nholdzkie
      New Member
      • Aug 2007
      • 10

      #3
      Reversing String Data

      The Program Should Output A Reverse Of The Inputed Data..
      Ex.
      When I Enter Garlic, The Program Should The Output cilrag

      Thank You Very Much...

      Comment

      • CPLUSPLUS
        New Member
        • Aug 2007
        • 4

        #4
        Please try the following program

        <code deleted>

        Hope this helps you.
        Last edited by Banfa; Aug 28 '07, 10:40 AM. Reason: Code removed as per the posting guidelines

        Comment

        • rhitam30111985
          New Member
          • Aug 2007
          • 112

          #5
          try this:
          <code removed>
          Last edited by Banfa; Aug 28 '07, 10:46 AM. Reason: Code removed as per the posting guidelines

          Comment

          • Dipanwita
            New Member
            • Aug 2007
            • 6

            #6
            try this.

            <code removed>
            Last edited by Banfa; Aug 28 '07, 10:47 AM. Reason: Code removed as per the posting guidelines

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              Originally posted by CPLUSPLUS
              Please try the following program

              <code deleted>

              Hope this helps you.
              Use the Code tag.
              Please before do post read the Post Guide Lines at the right side top-edge.

              You can also doing using Standard API most probably strrev instead of writing your own Code.
              It is better to write your own API.
              But sometimes the time is main factor in Software Development.

              Kind regards,
              Dmjpro.
              Last edited by Banfa; Aug 28 '07, 10:40 AM. Reason: Code removed as per the posting guidelines

              Comment

              • Banfa
                Recognized Expert Expert
                • Feb 2006
                • 9067

                #8
                nholdzkie

                The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

                Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

                Then when you are ready post a new question in this thread.

                Banfa
                Administrator

                Comment

                • Banfa
                  Recognized Expert Expert
                  • Feb 2006
                  • 9067

                  #9
                  Please not that double posting is also against site rules, I have merge your 2 threads into 1.

                  And while you are reading the posting guidelines you may wish to pay particular attention to the section on naming threads.

                  Comment

                  • nholdzkie
                    New Member
                    • Aug 2007
                    • 10

                    #10
                    ok am sorry for i didn't read your GUIDELINES yet. can i ask one more question?? if you don't mind what syntax or functions can i use for reversing inputed data? i hope you do can help me.

                    Comment

                    • Ganon11
                      Recognized Expert Specialist
                      • Oct 2006
                      • 3651

                      #11
                      There are several methods of doing this, and some of them require only simple knowledge of strings and assignment operators. Why not attempt the problem first and show us what you come up with?

                      Comment

                      • nholdzkie
                        New Member
                        • Aug 2007
                        • 10

                        #12
                        so far this is my code... can you help me??
                        cout<<"enter word: ";
                        cin>>word;
                        cout<<word;

                        Comment

                        • sicarie
                          Recognized Expert Specialist
                          • Nov 2006
                          • 4677

                          #13
                          Originally posted by nholdzkie
                          so far this is my code... can you help me??
                          cout<<"enter word: ";
                          cin>>word;
                          cout<<word;
                          Sure, as you have attempted this yourself, what is your algorithm for reversing the string? Once we make sure your algorithm logic is correct, then we can code it.

                          Comment

                          • nholdzkie
                            New Member
                            • Aug 2007
                            • 10

                            #14
                            i will make an algoritm first tnx for sharing

                            Comment

                            • nholdzkie
                              New Member
                              • Aug 2007
                              • 10

                              #15
                              I just made this algorithm

                              1. input a character string call it word
                              2. set the first character of string as index 0,
                              3. set the second character as index 1
                              and third is index 2 and so on until the last character of the string call it index n.
                              4. then display the character string from index n until index 0

                              I think we should use for loop for this code which is impossible for me to code without using function.

                              Comment

                              Working...