answersLogoWhite

0

Well, it will be slow and inefficient:

rec_strcpy (char *to, char *from1, char *from2)

{

. if (*from1) {

. . *to = *from1;

. . rec_strcpy (to+1, from1+1, from2);

. } else if (*from2) {

. . *to = *from2;

. . rec_strcpy (to+1, from1, from2+1);

. } else {

. . *to = '\0';

. }

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Write a program using recursion which should take two values and display 1st value raised to the power of second value?

Write a program using recursion which should take two values and display 1st value raised to the power of second value.


How do you concatinate two files in c plus plus?

Copy the first file then append the second file to the copy.


'c' code to compare two strings using strcmp function?

char one [] = "A string" ;char two [] = "Different String" ;if (strcmp (one, two) == 0){puts ("The two strings are identical") ;}else{puts ("The two strings are different") ;}


Write a c program to copy two strings using pointers?

nahi malum


To copy two strings using strcpy?

Using strcpy and strcat. Or sprintf. Or strlen+memcpy. There are more than solutions.


How many types of recursion are there in c language?

Recursion in c language is a method where the function calls itself, within or outside the scope. Using Recursion, complicated problems can be divided into smaller parts so that solving them becomes more manageable. The recursion technique is available in Java, JavaScript, and C++.serves the same purpose. The type of Recursion in C • Direct Recursion • Indirect Recursion. Direct Recursion Recursion can call the function n-number of times. In the case of direct Recursion, the function calls itself inside the same position or in the local scope Direct Recursion problems are the Fibonacci series, a program to print 50 natural numbers. Indirect Recursion In the case of Indirect Recursion, a function X calls function Y, and function Y calls any function Z. Under certain conditions, function Z calls function A. In this case, function A is indirectly related to function Z. Indirect Recursion is also known as mutual Recursion, as more than one function runs a program. It is a two-step recursive function call process for making a recursive function call. Below mentioned are also type of Recursion: Tail Recursion No Tail/Head Recursion Linear Recursion Tree Recursion Tail Recursion A function is said to be tail recursion if it calls itself and also calls the last or the previous statement executed in the process. Head Recursion A function is said to be Head Recursion if it calls itself and also calls the first or the beginning statement executed in the process. Linear Recursion A function is said to be a linear recursive function if it makes a single call to itself each time the procedure executes itself and grows linearly depending on the size of the problem. Tree Recursion Tree Recursion is different from linear Recursion. Rather than making only one call to itself, that function makes more than one recursive call to the process within the recursive function. Following are the steps to solve the recursive problem in C: Step 1: Create a function and assign the work a part should do. Step 2: Select the subproblem and assume that the function already works on the problem. Step 3: Get the answer to the subproblem and use it to resolve the main issue. Step 4: The 90% of the problem defined is solved.


Do you play two strings on a guitar at the same time?

Yes, when it is needed. YOu can use any combination of strings, so using all 6 at the same time is just as common as using one string.


What is the Program for compare two strings using OR operator in java?

The String class includes two helpful methods: equals and compareTo.string1.equals(string2) will return true if the two strings contain the exact same charactersstring1.compareTo(string2) will return an int which describes the lexicographic relationship between the two strings. It will return a negative value if string1 is "less than" string2, a positive value if string1 is "greater than" string2, or zero if the two are equivalent strings.


What is the exact meaning of recurrsion?

Recursion (n). See "Recursion (n)." Seriously, recursion is doing something over and over a certain number of times, such as a loop in a computer program, or "lather, rinse, repeat." Two wrongs don't make a right, but three rights will get you back on the freeway. ■


What did David's slingshot look like?

It was a pouch with two strings attached to it.


Write a script that accepts two strings from the user and compare two strings in web technology?

how to compare two strings that take input from the user and compare it. For example: i give first string as "THE" and give second string as "HTE" then return "match" if i give first as"THE" nd second string as "EHI" then return "NOtMatch" witout using STRCMP ... please help me


Can a double bass play chords?

Yes, Double Bassists can play chords by drawing the bow across two strings as opposed to one or by using pizzicato across two strings, and by placing their fingers where they want depending on the note they want to produce.