OK. This is even easier. I used the void return type for checkString(), like your code had, although your description mentions an int return to it is needed.
Code:
#include<stdio.h>
#include<string.h>
#define MAX 20
void checkString(char string1[], char string2[]);
int main(void) {
char string1[MAX] = "abbcbasdfg";
char string2[MAX] = "absdg";
checkString(string1, string2);
printf("\n");
return 0;
}
void checkString(char string1[MAX], char string2[MAX]){
int i,j,ok=0;
for(i=0,j=0;string1[i];i++) { //smoke & mirrors! ;)
if(string2[j]==string1[i]) {
++j;
}
}
if(j==strlen(string2)) {
ok=1;
printf("Yes, the second string can be made from letters in the first string\n");
}else {
printf("No, the second string can't be made from letters in the first string\n");
}
}