C++ Strings

C++ Strings

Strings are used for storing text/characters.

For example, “Hello World” is a string.

A string variable contains a collection of characters surrounded by double quotes: Continue reading C++ Strings

C Strings

Strings

Strings are used for storing text/characters.

For example, “Hello World” is a string of characters.

Unlike many other programming languages, C does not have a String type to easily create string variables. Instead, you must use the char type and create an array of characters to make a string in C:

char greetings[] = “Hello World!”;

Note that you have to use double quotes (""). Continue reading C Strings