#include <iostream>
#include <fstream>
#include <string>
#include <cctype>

using namespace std;

const int num=1000;

int main(int argc, char *argv[]){

  if (argc == 2){

    ifstream file;

    file.open(argv[1]);

  }

  else cout << "You typed only one file" << endl;

  ifstream file;

  file.open(argv[1]);
  string space;
  char word;

  int i=0;

  int w=0;
  int s=0;

  char letter[num];

  int letter1[num];
  while (file>>word)

        {

          i++;
          letter[w]=word;


                  w++;

        }


      cout << endl;
cout << "Words: " << i << endl;
      file.close();
      for (int i=0; i < w; i++){

      }

      if (letter[0] >='a' && letter[0]<='z' ){
        cout << "The first letter is not a capital sorry" << endl;



      } 

      if(letter[i-1] != '.'){
        cout << "You forgot a period at the end of your scentence." << endl;


      }

      file.open(argv[1]);

      file >> noskipws;
      while(file >> space){
        i++;
        cout << letter[i];
}
      cout << i << s << endl;

      for(int i=0;i<s;i++){



}
      getline(file,space);
      if(isspace(letter1[i]) == ' '){
        cout << "You can only have one space." << endl;


      }
      cout << letter[i];



}

I can't get the program to work properly I am really new to all this stuff so if anyone can give me pointers I will appreciate it. P.s I have been reading and trying to understand how to solve this for a whole week.=(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.