Click here to Skip to main content
16,016,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every body ,

recently I needed this program in my work and I hope that you help me in c++ programming language :

how I can write the code which it can distinguish and recognize any input character and then separate any input apart from the other and put each of them with its type such as :

# is special character
main is reserved word
33 is number

and other cases in the program of C++ ...

and I wish to do it with function not simple code ?

any one have any code with this idea ... i beseech him to give me it to accomplish my code with full execution please ...

and thanx 4 all.
Posted
Comments
Abhinav S 14-Nov-10 1:16am    
What have you tried so far? If you've tried something post it here and someone may be able to help you.

1 solution

You need to develop a scanner for a language, don't you?
If the above task is not homework, then have a look at flex[^], it may help you a lot (if it is homework, I suppose you need to 'manually' implement the scanner...).
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900