Allocate memory for a string of 15 characters and assign “new string” to it. Print the string. Now, try following options: Change the string to “another string” using assignment operator. Change the string to “another string” using strcpy. Note down whether the address changes in both cases or not.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question
100%

Allocate memory for a string of 15 characters and assign “new string” to it. Print the string. Now, try following options:

  1. Change the string to “another string” using assignment operator.
  2. Change the string to “another string” using strcpy.

Note down whether the address changes in both cases or not.

 

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT