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;
}
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...