Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I am new in C++ and I am sorry if this is a dumb question. My question is very simple someone please tell me how can I convert a string to character array?
As per my knowledge you can simply call c_str method see the below code:
c_str
string test = "test string"; cout << "I am printing the first index of the character array" << test.c_str()[0];
Try this and let me know in case of any problem.
Add a comment