Question

You have two arrays which are char Test1[20] = Hail and char Test2[20] = City. You used the function strcpy (Test2, Test1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given that

Two arrays they are

Test1[20] = "Hail"

Test2[20] = "City"


strcpy(A,B) is a string copy function Contents of B array copies to A array. So

*strcpy(Test2,Test1)* here Test1 content copied to Test2 and final answer is


*strcpy(Test2,Test1) = Hail

Add a comment
Know the answer?
Add Answer to:
You have two arrays which are char Test1[20] = "Hail" and char Test2[20] = "City". You...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In C Programming Write a program named CompareStrings. You will need two char arrays, name them...

    In C Programming Write a program named CompareStrings. You will need two char arrays, name them one and two, and have enough room for single words. Ask the user to enter two words (lower case), compare the words, and say if the first word is before or after the second word in lexigraphical order.

  • Question 1 Which pre-written C function can be used to determine if two strings are the...

    Question 1 Which pre-written C function can be used to determine if two strings are the same? A) equals B) strcmp C) strlen D) strcpy E) None of the Above Question 2 The function below is most like which existing string function? int f(char a[ ]) {                int count = 0;                while (a[count] != ‘\0’)                               count++;                return count; } A) strcat B) strcmp C) strcpy D) strlen E) None of the Above Question 3 The function...

  • C++ and/or using Xcode... Define a class of rational numbers. A rational number is a number...

    C++ and/or using Xcode... Define a class of rational numbers. A rational number is a number that can be represented as the quotient of two integers. For example, 1/2, 3/4, 64/2, and so forth are all rational numbers. (By 1/2, etc., we mean the everyday meaning of the fraction, not the integer division this expression could produce in a C++ program). Represent rational numbers as two values of type int, one for the numerator and one for the denominator. Call...

  • Lab 3 Step One First, create an empty directory for lab3. There is no starter code for this lab. You will be throwing an...

    Lab 3 Step One First, create an empty directory for lab3. There is no starter code for this lab. You will be throwing and catching exceptions in this exercise. Create a file called RuntimeException.h and put the following code in it. #include <string> class RuntimeException { private: string errorMsg; public: RuntimeException(const string& err) { errorMsg = err; } string getMessage() const { return errorMsg; } } Step Two In a new .cpp file in your directory, write a main function...

  • c++ help Write a program that: Creates two finite arrays of size 10 These arrays will...

    c++ help Write a program that: Creates two finite arrays of size 10 These arrays will serve as a storing mechanism for student grades in Classes A and B Uses a loop to populate the arrays with randomly generated numbers from 0 to 100.These numbers will represent student grades. Compute average grade of each class. Finally, output the two arrays and the message with two averages and best class. ("Class A average is: 65.43; class B average is: 68.90. Class...

  • PROGRAM DESCRIPTION: In this assignment, you will be creating a memory matching game in C++. In t...

    c++ PROGRAM DESCRIPTION: In this assignment, you will be creating a memory matching game in C++. In this game, the user will need to match up the pairs symbols A,B,C,D,E on a 4x4 array. For example, the array could be initialized like the following: In this case, X represents an empty slot. The goal is for the user to match the A to the A, the B to the B, etc, until all pairs are matched up to win the...

  • Parallel Arrays are two arrays, often containing elements of different datatypes that are synced with a...

    Parallel Arrays are two arrays, often containing elements of different datatypes that are synced with a common index. For this problem you are going to create a function called FindHighest that will accept two parameters: names and calls. The names list will contain the names of individuals that work on a help desk. The calls list will contain the number of calls they received in one day. Your function will return back to main the name of the person who...

  • Problem 2 Width and height of 10 rectangles have been stored in two arrays called W...

    Problem 2 Width and height of 10 rectangles have been stored in two arrays called W and H. Write a C program that will pass these arrays to a custom written function which will calculate the area of each rectangle and store the results in a third array called A. Your function should also print the area for the largest rectangle. W 12 18 5 17 6 6 22 5 8 H 10 23 4 11 2 9 35 7...

  • In this question you have to write a complete function. MyMedia Publishers uses two parallel arrays...

    In this question you have to write a complete function. MyMedia Publishers uses two parallel arrays to keep track of the number of subscriptions for each of their 50 publications. Array publications holds the names of the magazines and newspapers published and array subscriptions holds the number of subscriptions for each corresponding magazine or newspaper. You have to write a void function, called findMost Subs to determine which publication has the most subscribers. Function findMost Subs has to return the...

  • For the following task, I have written code in C and need help in determining the...

    For the following task, I have written code in C and need help in determining the cause(s) of a segmentation fault which occurs when run. **It prints the message on line 47 "printf("Reading the input file and writing data to output file simultaneously..."); then results in a segmentation fault (core dumped) I am using mobaXterm v11.0 (GNU nano 2.0.9) CSV (comma-separated values) is a popular file format to store tabular kind of data. Each record is in a separate line...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT