The Big Master

String constant

In C++, a string constant, also known as a string literal, is...

In C++, a string constant, also known as a string literal, is a sequence of characters enclosed in double quotation marks (). It represents a fixed string value that is typically used in the program for various purposes such as displaying messages, initializing string variables, or passing string arguments to functions.

Here are some examples of string constants in C++:

"Hello, World!"              // A string constant representing the message "Hello, World!"
"Welcome to C++"        // A string constant representing the message "Welcome to C++"
"12345"                          // A string constant representing the sequence of characters "12345"
"Pakistan"                    // A string constant representing the name " Pakistan"

String constants can contain any combination of characters, including letters, digits, whitespace, punctuation marks, and escape sequences.

#include <iostream>
using namespace std;
int main()
{
    cout << "In the name of     Allah  "   ;
    cout << " Welcome "  ; 
    cout <<  "This is our first programming lecture ";
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    cout  << "In the name of     Allah  " << endl  ;
    cout  << " Welcome "                        << endl   ; 
    cout  << " our first  lecture "           << endl   ;
    return 0;
}