I'm trying to write a program that accepts two string inputs in C that will then yield the result as the two strings interlaced.
An example of what I want:
input: abdc
input: efgh
result: aebfdgch
Here is the little bit of code that I have so far for that portion.
#include <stdio.h>
#include <string.h>
#define maxLen 100
int main() {
char string1[maxLen];
char string2[maxLen];
printf("please enter a string of up to 100 characters: ");
fgets(shuffleString,maxLen,stdin);
printf("please enter another string of up to 100 characters: ");
fgets(shuffleString2,maxLen,stdin);
return 0;
}
I have tried a lot of things to make the shuffling work, but nothing I seems to. This is for a homework assignment so I'm not trying to have someone write the code for me, but some examples and explanations would be nice. Also, if it's not already obvious, this is for an introuctory level C class so I would appreciate keeping things as close to my level as possible.