String Constants Assignment Help

Assignment Help: >> Basic Elements of C++ Character Set - String Constants

String Constants

A string constant is a series of characters enclosed inside a pair of double quotes. The string constant might also involve numbers, special characters and blank spaces.

Example

" Hello!"

" I'm going for shopping today. Shall you come?" " 549, The Mall, Shimla."

" 4321-1234" " O"

String constant "O" differs from the character constant 'O'. The string constant does not have an integer value such as a character constant has. A string constant is always followed through a null character ('\0').

The following program will accept your name, address and phone number as string constants and show them: -

#include <iostream.h>

void main(void)

{

cout<<" Name:         Rajeev\n";

cout<<" Address: 549, ABIDS, Hyderabad\n";

cout<<" Contact: 040-211717\n";

}

The output is:

Name:            Rajeev

Address: 549, ABIDS, Hyderabad

Contact: 040-211717

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd