Question: c++ Consider the following recursive function. What does it do? You may assume that ptr initially points to a character array initialized to a string

c++ Consider the following recursive function. What does it do? You mayc++

Consider the following recursive function. What does it do? You may assume that ptr initially points to a character array initialized to a string literal (the final character of which will always be the 'IO' terminator character). int func(char* ptr) \{ if(*ptr == ' \0) return 0; return 1+ func ( ptr +1); \} (A) Stack Overflow (due to infinite recursion) (B) Calculates the number of characters in the string referenced by ptr. (C) Calculates the size of the character array referenced by ptr. (D) The results are unpredictable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!