Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First try to predict the outcome of the following C program. Then, run it to find out whether your prediction was correct or not. Try

First try to predict the outcome of the following C program. Then, run it to find out whether your prediction was correct or not. Try to justify your observation using the concept of pointers in C.
Hint: Please note that:
p is a pointer initialized to letter 'o' in the string "hello world!"
str which is the name of char array containing the "hello world!" string is considered to be the pointer to the first letter 'h'
expression (p- str) subtracts a pointer from the other resulting in an integer counting how many characters can be fit between these two pointers.
p[-2] is a character stored two letters before the current position that pointer p refers to
p-- moves the pointer p backward in the string "hello world!"
++p moves the pointer p forward in the string "hello world!
#includestr[15]char**p=&str[4]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

What is Pr(St Answered: 1 week ago

Answered: 1 week ago