C++ How to create a function that checks to see if a letter exists inside of an Array or not.   #include using namespace std;   int File(string f, string w[]) { int Count = 0; ifstream i; i.open(fileName); if (i.is_open()) {  cout << "Your file was imported!" << endl;  while (inputStream >> words[Count]) {   Count++;  } } else {  cout << "Your file doesn't exit." << endl; } inputStream.close(); return Count; } int main(){ const int Size = 10; string m[Size]; string f = "da.txt"; int n; string userGuess; n = openFile(f, m); string words;    cout << "What word would you like to guess?" << endl;        cin >> words;        return 0;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question

C++

How to create a function that checks to see if a letter exists inside of an Array or not.

 

#include <iostream>

using namespace std;

 

int File(string f, string w[]) {

int Count = 0;
ifstream i;

i.open(fileName);

if (i.is_open()) {

 cout << "Your file was imported!" << endl;

 while (inputStream >> words[Count]) {
  Count++;
 }
}
else {
 cout << "Your file doesn't exit." << endl;
}
inputStream.close();
return Count;
}

int main(){
const int Size = 10;
string m[Size];
string f = "da.txt";

int n;
string userGuess;

n = openFile(f, m);

string words;
   cout << "What word would you like to guess?" << endl;
       cin >> words;
      
return 0;

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr