string s1 = "Hello";
string s2 = "World";
string s3 = (s1+s2).substr(5);
a) Error because s1+s2 will result into string and no string has substr() function
b) Segmentation fault as two string cannot be added in C++
c) The statements runs perfectly
d) Run-time error
What happens when objects s1 and s2 are added?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when objects s1 and s2 are added?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!