[Solved] Incomplete type is not allowed in swap program
The below program does what you want: #include<stdio.h> #include<conio.h> #include<string.h> void swapping(char s1[],char s2[]) { char temp[30]; //create an array of char in order to store a string strcpy(temp,s1); strcpy(s1,s2); strcpy(s2,temp); //use strcpy to swap strings } int main (void) { char st1[30],st2[30]; printf(“Enter the first string”); scanf(“%s”,st1); printf(“Enter the second string”); scanf(“%s”,st2); //the & … Read more