So I don't really understand what you were trying to do but it seems like you wanted your code to output characters for you and you didn't seem to get a hold of the code right. So I would give an example of how to tell your code to output characters for you
#include<iostream>
Using namespace std;
Int main()
{
char str[10];
cout<<"what is your name">>endl;
scanf("%[^\n]s",str);
cout<<"your name is <<str<<endl;< p="">
}