Hello everyone names Matt I'm new to the programming world, I have some assignments that im starting in my college class and would need some assistance getting them done.
I am using the Xcode for Mac so im also learning how everything is done. I had a bit of exercise on a pc and it seemed to be easier when debugging i was able to input examples into the black debugging screen I'm not sure if its called the command screen or not.
Here is my question that I'm working on
Write a program that opens a file and counts the whitespace-separated words in that file.?
My code that i wrote for this example is as follows...
using namespace std;
string filename = "Question 1.cpp"; // File name goes in here
int wordcount = 0;
while (file >> word)
cout << "The file \"" << filename << "\" has " << wordcount << " words." << endl;
I was much used to using visual studio where i would compile and the window would ask for me to input a text or numbers etc... so then depending on my code it would execute the program based on my input parameters.
Can i run a window that prompts me in Xcode to input for example a string name and then it executes to count the word spaces