Hi,
I am not sure what you actually intended to say! but here's a solution. Please see if it helps:
Code:
#include <stdio.h>

int main() {
    char str1[] = "aman";
    char str2[20] = "Vini";
    
    char *ptr2 = str2;
    char *ptr1 = str1;
    int count =0;
    int counter =0;
    while( '\0' != *ptr2 ){
           ptr2++;
           count++;
    }
    
    while( '\0' != *ptr1 ){
           *ptr2 = *ptr1++;
    }

    *ptr2 = '\0';
    
    printf("str2 = %s, Length of first string = %d", str2, count);
    
    ptr2 = str2; // Resetting the pointer
    
    while(counter < count){
                  printf("%c", *ptr2++ );
                  counter++;
    }
    
    return 0;

}

Last edited by shabbir; 30Aug2008 at 23:41.. Reason: Code block