Newbie C++ programmer again...

Eric Samson airickjay@hotmail.com
Thu, 17 Aug 2000 18:39:37 MST


Hello again all...

I am trying to figure out the proper way to use the isalpha function, when I 
enter a digit, it returns 0, and when I enter an alpha character, I get a 
segmentation fault..  Can anyone tell me what I am doing wrong??

Thanks in advance,

Eric

Program:

#include <iostream.h>
#include <ctype.h>


int main ()

{

	int flag;
	int tester;


	cout << "\n\nenter some input :";



		cin >> tester;


		flag = isalpha (tester);



		cout << "\n\n" << flag << "\n\n";

		return 0;

	}

output:
---------------------
alpha character

$ ./test


enter some input :g
Segmentation fault

----------------------

numeric
$ ./test


enter some input :5


0
-----------------------

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com