answersLogoWhite

0

#include<iostream>

#include<string>

int main()

{

std::string s("The quick brown fox jumps over the lazy dog");

std::cout<<s.c_str()<<std::endl;

std::cout<<"The previous string is "<<s.size()<<" characters long."<<std::endl;

}

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

Write a program to find the length of a string in shellscript?

This is an assignment not a question.


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Write the program in Linux to find the reverse of any string?

i am sam


How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))


Do I need to write a program to find a substring in a given string in c plus plus?

No.


Write a c program using string concept enter a sting and replace the new string in to old string and find no of occurrence?

print c co com comp compu


How do you write a program to find the no of words in a given string in dot net?

You find a language that can be targeted towards the .NET Framework. What you are suggesting is something related to string manipulation and you can work with delimiters.


Find length of the string without using loops and control structures?

length = strlen(string);


Program to find the size of the string without using string functions?

You can't. If you want to find the length of a String object, you must use at least one of the String methods. Simply iterate over your char* and count the number of characters you find before you reach the null character . int strLength(const char* str) { int length = 0; // take advantage of the fact that all strings MUST end in a null character while( str[length] != '\0' ) { ++length; } return length; }


Write a program to input a string in the form of name and swap the initials of the namefor example enter a string is rohit Kumar sharma and should be printed RK Sharma?

Get the string from user , then U Split the string with space and put in a string array .Then Find Length of string array , Take first letter of each element in array, Except last. Assigned those to a string, then Fetch Last element of an array, Add it With that String.That's it.


Write a Java Program to find occurences of given word in a text?

Check the documentation of the String class, for a method that searches for a substring.

Trending Questions
Why your car spends too much gas? When the body is relying on internal energy reserves to continue meeting its energy demands it is in the? How do you remove car door sills the plastic at the bottom of the door on the inside of the car so I can hide wires under it 2001 Ford Taurus? How many tens are in 306? Who did tupac play in raisin in the sun? Is it illegal to shoot a animal with a bb gun? Acetaminophen a common aspirin substitute has the formula C8H9NO2. Determine th enumber of molecules of acetaminophen in 500 mg tablets. Please right it in steps on how to do it.? What dose a dude mean? Which two great thinkers of Greece are also known as father politics and father of debate? What is the homograph for take up a weapon and part of the body? Why did Peter the Great kill his son? Should marketing managers or business managers in general refrain from producing profitable products that some target customers want but that may not be in their long-run interest Should firms be expe? Where do you find skuntank on pokemo n pearl? What is the difference between direct tax and indirect ta? How do you prepare poison? In a class of 150 students 55 speak En glish 85 speak Telugu and 30 speak neither English nor Telugun How many speak both English and Telugu? What is the death place of the beatles? Where can you find information on the 19th Infantry 24th Division in New Guneia or Leyte? Which side of a 2001 Chevy 1500 pick up is the number one bank? When was John D. Sheridan born?