Just started programming, please help me:)

Discussion in 'C++' started by j+e, Feb 18, 2009.

Thread Status:
Not open for further replies.
  1. j+e

    j+e New Member

    Joined:
    Feb 18, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Hi! I have just started programming and I have a question for my assignment:

    When the input is ABCDE, i want the Output to be EDCBA, but for some reason I cannot understand, the output i get is: EDCDE

    I have written the following in my program:

    for (int i = 0; i < b; i=i++)
    {
    char temp1 = a;
    a = a[(b-1)-i];
    a[(b-1)-i] = temp1;
    cout << a ;

    Can somebody please help me?

    Thanks!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,336
    Likes Received:
    377
    Trophy Points:
    83
    Duplicate of Please help me:). Thread closed. Please do not create the same thread over and over again.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice