What is string in c plus plus?

1 answer

Answer

1237394

2026-08-27 22:25

+ Follow

A String is a variable that represents a list, or array, of characters. They are normally assigned using double quotes (""). When using strings you must import string header file

#include

and then an example of a string

string mystring = "This is a string";

This give the variable 'mystring' a value of "This is a string".

A string can also be referred to as an array of characters

char string [10];

Would make the variable string to an array of characters with length ten.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.