Skip to content

Updated miscellaneous.cpp #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Standard_Template_Library(stl)/Miscellaneous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ Ans -

Now, node has data of next node and refer to the next to next node.

2 . In c++, undefined strings are char array like in const std::string message = "Hello" + "", both the "Hello" and empty string are char array and in c++, you can't concatenate two char
array or one char array and one char data type but string data type can be concatenated with char array or char data type and the output will be string data type. Note: str[2] are char type.
for ex;
const std::string hello = "Hello";
const std::string message = hello + ", world" + "";

it works, because the operations the compiler would see were std::string + const char[8] + const char[1]. Here, the first addition can be converted to std::string + const char*, and here the addition
operator is defined, and returns a std::string. So the compiler has successfully figured out the first addition, and since the result was a string, the second addition looks like this: std::string + const char[2],
and like before, this isn't possible, but the array can be converted to a pointer, and then the compiler is able to find an addition operator that works, again resulting in a std::string.





Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy