0

I am defining a function with default parameters.

state* construct_state(int final_state=0, int start_state=0)      
{
      //code
}

However there is some error

nfa.c:16:39: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token

Where am I going wrong?

2 Answers 2

5

There are no default arguments in C.

Sign up to request clarification or add additional context in comments.

Comments

1

As far as I know, you cannot provide default arguments in C.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.