C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 8.13E

(What Does This Code Do?) What does this program do?
1. // Ex. 8.13: ex08_13.cpp
2. // what does this program do?
3. #include <iostream>
4. using namespace std;
5.
6. void mystery1 (char*, const char*); // prototype
7.
Fig. 8.19 What does this program do? (Part 1 of 2.)
8. int main () {
9. char string1 [80];
10. char string2 [80];
11.
12. cout<< ”Enter two strings:” ;
13. cin >> string1 >> string2 ;
14. mystery1 (string1, string2);
15. cout<<string1<<endl;
16. }
17.
18. //what does this function do?
19. void mystery1(char* s1, const char* s2) {
20. while (*s1 != ‘\0’) {
21. ++s1;
22. }
23.
24. for (;(*s1 = *s2); ++s1; ++s2) {
25. ; // empty statement
26. }
27. }
Fig 8.19 What does this program do? (Part 2 of 2)

Blurred answer
Students have asked these similar questions
answer should avoid using AI (such as ChatGPT), do not any answer directly copied from AI would and explain code
answer should avoid using AI (such as ChatGPT), do not any answer directly copied from AI would and explain code
Write a c++ program that will count from 1 to 10 by 1. The default output should be: 1, 2, 3, 4, 5, 6 , 7, 8, 9, 10 There should be only a newline after the last number. Each number except the last should be followed by a comma and a space. To make your program more functional, you should parse command line arguments and change behavior based on their values. Argument Parameter Action -f, --first yes, an integer Change place you start counting -l, --last yes, an integer Change place you end counting -s, --skip optional, an integer, 1 if not specified Change the amount you add to the counter each iteration -h, —help none Print a help message including these instructions. -j, --joke none Tell a number based joke. So, if your program is called counter, counter -f 10 --last 4 --skip 2 should produce 10, 8, 6, 4 Please use the last supplied argument. If your code is called counter, counter -f 4 -f 5 -f 6 should count from 6. You should…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License