online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <string_view> #include <iostream> int main() { std::string_view str = "This is an example"; auto X = str.find_last_of('s'); // // Make sure the character exists in the string if (X != std::string_view::npos) { std::cout<< str << std::endl; std::cout<< "Last time 's' was found was in position: " << X << std::endl; } else { std::cout<<"Character did not exist in string.\n"; } if (!str.empty()) std::cout<< "Last character in this example is " << str.back(); else std::cout << "Cannot get the last character in an empty string!"; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue