All pastes #467119 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-02 10:28 UTC
rendered paste body
#include <iostream.h>
#include <conio.h>
#include <string.h>
#include <windows.h>

int GetNumberofLetters( char* szString )
{
     int iLen = ( int )strlen( szString );
     int iNum = 0;
     for( int i = 0; i >= iLen; i++ )
     {
          if( ( szString[i] >= 'a' && szString[i] <= 'z' )
          || ( szString[i] >= 'A' && szString[i] <= 'Z' ) )
          {
               iNum++;
          }
     }
     return iNum;
}



int main()
{

	main_loop:
	char cName[99];
	int iLength;
	cout<<"Enter your name ";
	cin>>cName;
	iLength = GetNumberofLetters( ( char* )cName );
	if( iLength < 1 )goto wrong;

	cout << "The number of letters in your name is "<< iLength;
	getch();

	return 0;

	wrong:
	cout<<"Input only letters please."<< endl;

	goto main_loop;

}