Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How can I make the word which is a string the user inputs into an array right no

ID: 3654217 • Letter: H

Question

How can I make the word which is a string the user inputs into an array right now I am getting an error that size of word cannot be determined but if i changed the variable to "Mom" it runs fine template// This function first creates a stack, then it takes the word, which is a string, and put's each charcter into an array // then we find the length of the word and run a for loop checking each character in the array if it is an alphabetic character // and then adding the character to the stack, after it has gone through the length of the word it stops and returns the stack // I had an error here don't know what is going on if I enter "word" as a string with quotations the program does not encounter any errors // But if i declare word a string the program says it cannot initialze the size of word stack load(const string & word) { stack pword; char str[ ] = word; int i = 0; int length = word.size(); for (i = 0; i = length; i++) { if(isalpha(str[i])) { pword.push(str[i]); } } return pword; }

Explanation / Answer

#include "stdafx.h" #include #include #include #include using namespace std; bool inputString (const string &str); bool palindromeTest (const string &str); void printMessage (const string &str); int _tmain(int argc, _TCHAR* argv[]) { string str; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote