hi im having alot of trouble with this particular code
the idea is to read text from a file and print it on screen, i have done that. Next i needed to ouput the longest word onto the screen, this i have done also
The bit im stuck with: I need to count the number of lower and upper case 'L's in that file and print it on screen (only that letter).
the error i get is: error C2664: 'isalpha' : cannot convert parameter 1 from 'char *' to 'int'
heres what ive got so far:
#include <iostream>
#include <cstring>
//#include <string>
#include <fstream>
#include <cctype>
#include <stdio.h>
using namespace std;
int main()
{
//some predefined variables
char FileTxt[150];
char * LWord = " ";
int iCounter = 0;
int i = 0;
//--------------------------------------------------------------------------------
//-----------------some more code in between---------------------------
//--------------------------------------------------------------------------------
char *Letter = "l";
char *TokLetter;
strcpy(TokFile, TokLetter); //TokFile stores the whole text from a file; im using it for other purposes too, so rather then messing with it, I want to copy it
while(TokLetter != NULL)
{
if(isalpha(Letter))
{
iCounter = iCounter + 1; //increment the int counter everytime it finds an 'L/l'
}
else
{
}
//TokLetter = strtok(NULL, " .1234567890");
}
cout<<"The number of upper and lower case 'l' letters is: "<<iCounter<<endl;