Thread: i need help

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    7

    Unhappy i need help

    if the user key in abc, the ouput should be acbbca(where by the reversed string is inserted one character after the other)

    i've wrote the code but it display null
    Here's the code of the functio:

    void InsertStringRev( char input[]){
    int r;
    char reverse[20];
    strrev(input);
    strcpy(reverse, input);
    strrev(input);
    for( r=0; r < strlen( input ); r++)
    gotoxy(5,16);printf("Result :%s%s",input[r],reverse[r]);
    getch();clrscr();
    }

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Your printf is wrong, try this:
    Code:
    printf("%c%c",input[r],reverse[r]);
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed