using namespace std;#include <iostream>#include <string>int main(){ string fun; fun="blah"; fun[1]='\0'; cout<<"fun="<<fun<<"\n"; return 0;}
I guess I'll try a different way. Probably there's functions or overloaded operators I can use or something. If I use the above code the output is
fun=bah
If it was a char array the output would have been
fun=b
Adios