Hi I need some help with these C++ programs in Dev C++:
#include <iostream>
using namespace std;
int main()
{
std:string str, str2, str3;
std::cin >> str;
std::cin >> str2;
std::cin >> str3;
std::cout<<str.length()<<std::endl;
std::cout<<str2.length()<<std::endl;
std::cout<<str3.length()<<std::endl;[/QUOTE]
I type in a word for each string and I want to organise the result by the number of letters in each word from largest to smallest or vice versa
Second question
#include<iostream>
using namespace std;
int main()
{
char ch, space, number;
space = 95;
number = 35;
cout << "Enter a char:";
ch=cin.get();
{
if (ch = 32)
cout << space << endl;
}
{
else if(ch = 48,49,50,51,52,53,54,55,56,57)
{
cout << number << endl;
}
I'm simply having problems with the result. It should be self explanitory looking at this, If I type a 'space' I want an underscore, this works. But when I go to type any 1 digit number I still get an underscore instead of a '#'
Thanks for any assistance :)
and Im very new at this, so if you say some technical jargon - I won't understand.