Here is what I have.
cout << "Welcome to the Slogan Expenditure 3542" << endl;
cout << "**************************************" << endl;
cout << "Please enter in the slogan to be priced: " << endl;
cin >> adPhrase;
cout << "Please enter the expected cost per letter. " << endl;
cin >> costPPL;
cout << endl;
for(i=0;adPhrase[i]!='\0';i++){
if (adPhrase[i] == ' '){
i++;
}
}
cout << "Your slogan has " << i << " letters in it"<< endl;
cout << endl;
cout << "This will cost approximately $"<< i*costPPL << " total" << endl;
The for loop is to read the text entered by the user, it reads the first word just fine, but stops at the first word. . I thought that if I used an if statement to account for the spaces it would move on in to the next word, but that does not appear to be the case. I'm lost, and the only help I've received is to use NULL, but there's nothing in the material for the assignment that tells me how or even where to use it. I can't help but feel that I'm close to where I need to be...just not quite there.

New Topic/Question
Reply




MultiQuote





|