4

I happened to see quantSpec[(1024)] in FDKAAC audio codec. It's written in C, C++.

What does the parenthesis mean? Is it not as same as quantSpec[1024]?

1
  • 3
    It's just some redundant syntax that detracts from readablility. Do not copy. Commented Mar 16, 2015 at 1:44

2 Answers 2

3

It means nothing, they're exactly the same.

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

Comments

2

Use of parentheses is necessary when you want to change the order of precedence of operations when evaluating an expression. Sometimes, especially in long expression in the conditionals of if and while statements, presence of parenthesis make the code easier to read.

3 + 5*10 == 2 + 50

You can change the order of operations by using parenthesis:

(3 + 5)*10 == 8*10

In the example that you have presented, removing the parenthesis will not change anything.

2 Comments

It's the only way to change the precedence, but adding them where unnecessary, as here, doesn't make anything easier to read. It just provokes questions like this one.
@EJP, I have found long statements in the conditionals of if and while statements that are easier to read when there are paranthesis.

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.