#Mastery25<\/a> \u00a0A string<\/em> means an ordered sequence of characters, and in most programming languages such strings are enclosed in either single or double quotes. <\/span><\/p>\n \u00a0<\/span><\/p>\n In C++ the enclosing delimiters are double quotes. IFor example, the usual first C++ program displays the string literal “Hello, world!” on the screen with the following output statement.<\/span><\/p>\n \u00a0<\/span><\/p>\n Strings are objects that represent characters, it is actually a one-dimensional array of characters. It is kind of like the same way you declare an array but instead you use characters. Which is the structure of a string?<\/span><\/p>\n \u00a0<\/span><\/p>\n \u00a0<\/span><\/p>\n char name[number of elements] ={\u2018a\u2019, \u2018b\u2019, \u2018c\u2019};<\/span><\/p>\n or<\/span><\/p>\n char name[] ={\u201cabc\u201d };<\/span><\/p>\n \u00a0<\/span><\/p>\n You can represent a string the same way you represent an array.<\/span><\/p>\n \u00a0<\/span><\/p>\n 1<\/span><\/p>\n<\/td>\n 2<\/span><\/p>\n<\/td>\n 3<\/span><\/p>\n<\/td>\n<\/tr>\n a<\/span><\/strong><\/p>\n<\/td>\n b<\/span><\/strong><\/p>\n<\/td>\n c<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u00a0<\/span><\/p>\n \u00a0<\/span><\/p>\n \u00a0<\/span><\/p>\n \u00a0<\/p>\n A standard library in C++ provides a string class type. <\/span><\/p>\n \u00a0<\/span><\/p>\n There are other ways to declare a different type of string. <\/span><\/p>\n \u00a0<\/span><\/p>\n Using namespace std;<\/span><\/p>\n String name;<\/span><\/p>\n \u00a0<\/span><\/p>\n Or<\/span><\/p>\n \u00a0<\/span><\/p>\n Std:: string name;<\/span><\/p>\n \u00a0<\/span><\/p>\n A string can be also assigned to each other or appended together using the + operator.<\/span><\/p>\n Strings can also be found as compsrisons\u2026<\/span><\/p>\n \u00a0<\/span>One of the most confusing part of using char*s as strings is that comparisons tricky.<\/span><\/p>\n Here is a simple example of the usage of a string;<\/p>\n \u00a0<\/p>\n \u00a0<\/p>\n <\/p>\n \u00a0<\/span><\/p>\n \u00a0<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\n\n
\n \n \n \n \n \n \n \n WATCH MY VIDEO\u00a0https:\/