Ask Experts » Education » Exam Questions »

C Program to check the syntax of Function declaration

Date: 08 Jan 2016   Posted By: Vin     Group: Education    Category: Exam Questions   

I have tried to write a program to check the syntax of function declaration in C but it has generated a lot of errors. When I search on the internet I couldn't obtain the answer. The program must satisfy the following conditions:
1. Return_type fun_name (parameter);
2. parameter must be : type variable_name 1, type variable_name 2,......
Can you also include a program for function definition. Awaiting responses from experts.

Searching for code of a C program to check function declaration syntax? On this page, experts shall provide you the code.

Author: Bhuvaneswara Rao Nalla    11 Jan 2016      Member Level: Gold     Points : 4  (Rs 4)    Voting Score: 0

If I understood your problem correctly, your program needs to check many return types and parameters like char, int, float, long, double, struct, pointers to different data types, etc. To get some idea about implementation of the program, you may need to see the implementation of different standard functions in C, which return different data types or pointers to different data types. One such function can be "malloc" function, which can return pointers to different data types after typecast is done. Similarly, for a function that can take many number of parameters, you can go through the implementation of "printf" and "scanf" functions. Personally, I have never written a program to check the syntax of a function declaration.

Author: Vin    11 Jan 2016      Member Level: Silver     Points : 0    Voting Score: 0

Yes you are right, the program must satisfy all the conditions of data type. I need a program to check my answer. If there is time will you please help me by writing one program.

Post Answer

You must Sign In to post a response.

Post Answer        

Related Questions
  • Return to Question Index
  • Ask Question to Experts

  • Awards & Gifts
    Top Contributors
    TodayLast 7 Daysmore...

    ISC Technologies, Kochi - India. © All Rights Reserved.