Alright, I am having a problem with an error message that comes up, i am pretty sure the code is alright, but it might be the code, i have tried re-installing VB (Visual Basic 2010). i have tried a few things on the web and nothing. here is the error im getting...
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>K:\C++ Programming\20pg372\Debug\20pg372.exe : fatal error LNK1120: 1 unresolved externals
I just don't get it... Here is my code im trying to count the empty space in between each word in the file the user inputs...
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main ()
{
int size = 0, count = 0;
char ch;
int Option1;
string FILE;
cout <<"Hello, this program will count the number of words in a file of your choice!"<<endl;
cout <<"If you are ready to begin enter 1 and press enter, Press 2 and enter to exit"<<endl;
cin >> Option1;
if (Option1 == 2)
{
cout<<"Have a nice day"<<endl;
return 0;
}
if(Option1 == 1)
{
cout <<"Alrighty please enter the name of the file you wish to open"<<endl;
cout <<"Also include the file format! for example( .txt, .doc, .rtf ect.)"<<endl;
cin >> FILE;
ifstream in_stream;
in_stream.open(FILE);
if(in_stream.fail())
{
cout << "input file failed to open."<<endl;
exit(1);
}
in_stream >> ch;
while(in_stream >> ch)
{
if(isspace(ch))
{
count++;
in_stream >> ch;
}
}
cout<<count;
system("pause");
in_stream.close();
}
}