#include <iostream>
#include <string>
int main()
{
string str{}; // creating string
getline(cin, str);// using getline for user input
std::cout << str; // output string namePerson
if (str[0] >= 'a' || str[0] <= 'z')
str[0] -= 32;
return (0);
}
int main() {
string a="HELLO";
cout<<a[0];
}
string car = "audi";
char firstCharacter= car.at(0);
cout<< firstCharacter;
Code Example |
---|
Cpp :: pow c++ |
Cpp :: ? in cpp |
Cpp :: assign value to a pointer |
Cpp :: Maximum element in a map c++ |
Cpp :: binary to decimal |
Cpp :: c++ initialize size of 3d vector |
Cpp :: min heap |
Cpp :: queue |
Cpp :: c++ constructor |
Cpp :: reverse in vector c++ |
Cpp :: Check whether the jth object is in the subset |
Cpp :: bool nullable to bool c# |
Cpp :: c++ void poiinter |
Cpp :: building native binary with il2cpp unity |
Cpp :: lap trinh file explorer c++ |
Cpp :: arduino bleutooth module hc-05 with led |
Cpp :: c++ exeption handling |
Cpp :: how you can add intger value to string in c++ |
Cpp :: the number of ones int bitset |
Cpp :: jquery datepicker default date not working |
Cpp :: int and char in c++ compiler |
Cpp :: c plus |
Cpp :: multi variable assignment cpp |
Cpp :: cpp stacks |
Cpp :: passing array to the function c++ |
Cpp :: map::begin |
Cpp :: sfml hide message |
Cpp :: MPI_PUT |
Cpp :: run program until ctrl-d c++ |
Cpp :: c++ konsolenausgabe |