1. Home >
  2. Apps >
  3. Groups >

Program to check that the string you enter at runtime is a valid variable declaration

Question asked by dharam_241086 in #Coffee Room on Aug 8, 2008
dharam_241086
dharam_241086 ยท Aug 8, 2008
Rank E2 - BEGINNER
😛Hi! friends. this is a mind buster question for you,but it is very very urgent to answer this question as soon as possible, so this is a question :-

😕write a c /c++ program to check that the string you enter at runtime is a valid variable declaration like if a write "int" as a input than message will appear like"valid declaration",this programs also supports all possible combination like"unsigned int","long" and other combination.

Please write a program and send it fast.😁

Thank you for your help. 😁 Posted in: #Coffee Room
pradeep_agrawal
pradeep_agrawal ยท Aug 11, 2008
Rank C2 - EXPERT
Re: Program to check that the string you enter at runtime is a valid variable declara

The solution to the problem is a parser which parse the string and gives the output as valid or invalid identifier. You can use tools like Lex to write such parser. Lex is a Parser Generator tool. For more details on Lex see thread https://www.crazyengineers.com/forum/computer-science-engineering/2160-help-writing-compliers.html

-Pradeep

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up