suggest one loop logic for concatenating two strings without strcat
I have written a program which concatenate two strings without the help of strcat.
I have used two loops to make this logic.
But want to make the logic with one loop kindly review my code c++ program to concatenate two strings without using strcat and share your logic in comments section of blog so every visitor can read blog and your's code and compare both.
Thanks
Re: suggest one loop logic for concatenating two strings without strcat
If you would like comments re the code, then you should post it within this thread rather than providing a link.
PS There are several issues with that code.
Re: suggest one loop logic for concatenating two strings without strcat
Can you list down few of them?
Re: suggest one loop logic for concatenating two strings without strcat
Quote:
Originally Posted by
fahadmunir32
Can you list down few of them?
Yes if you post the code on this forum. Then I'll reply here.
Re: suggest one loop logic for concatenating two strings without strcat
Quote:
Originally Posted by
fahadmunir32
But want to make the logic with one loop kindly review my code
I can tell without even reviewing your code.
Introduce a function that copies a string from one location to another. Then use it twice to copy each of the source strings one after the other to the target string.
That's procedural programming in a nutshell. :)