#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    s[0] = 'b';
    s[1] = 'a';
    s[2] = '\0';
    cout << s;
    return 0;
}
I declare a string in my code and than assign character values using array indices. When I print the string it gives me no output. My question is why not?
What is the reason that it is giving no output?
 
     
     
    