Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Debug a String Code in C
0
votes
asked
Apr 6, 2018
by
anonymous
int main(void)
{
char in[20];
gets(in);
char in2[20];
gets(in2);
char out[39];
strcat(out,in);
int index = strlen(in);
while(index <39){
out[index] = in2[index-strlen(in)];
index = index + 1;
printf(out);
}
return 0;
}
Please
log in
or register to answer this question.
2 Answers
0
votes
answered
Apr 7, 2018
by
kodathalasudarshan reddy
(
340
points)
If u don't mine can u say what is the problem with the code.
Please
log in
or register to add a comment.
0
votes
answered
Apr 7, 2018
by
anonymous
I am trying to get it to consternate in and in2 but there seem to be a problem with this line - strcat(out,in); and may be this line - out[index] = in2[index-strlen(in)]; any assistance would be hugely appreciated.
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...