0
Is there any other method to copy string of A="hello"; to string B without using #Loops, #sitring functions, #simple assignment
i know it is possible..... i just want to know how many of you guys know about it...:p
5 Respuestas
+ 1
Without the use of string functions, you are going to have to use an assignment somewhere, so please elaborate on what's allowed.
+ 1
its a funny answer and you gys already know about it.........
actually this is a tricky question which is mostly asked on technical interviews....
.
.
.and about answers.....there are two ways to done this thing out...
1. simply put a goto and iteratively call a bunch of statements including if condition to terminate and continue after execution part.
2. we can also use RECURSION ...by calling the same function upto the length of string and terminate the recursion.
+ 1
But did you have to use an assignment symbol ANYWHERE in the examples you just provided?? Because in your title, you made is seem like using the equals sign wasn't allowed. Also GOTO coding is poor practice and tends to get really messy anyways.
0
with overloaded equal to operator you can copy one string to another
string A="hello";
string b=a;
now b holds value hello
0
here i have mentioned above to do not use the simple assignment