Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:24:12+00:00 2026-05-23T18:24:12+00:00

C declaration syntax is fairly convoluted … Which brings me to my question regarding

  • 0

C declaration syntax is fairly convoluted …

Which brings me to my question regarding casting syntax,

Simple types are easy enough, just put the type in brackets.
But what about types like,

int (*2Dap) [5]; or double (*fp) (double, double);

I guessing here, the rule is to just strip away the identifier (plus the semicolon) of a normal variable declaration and put it in brackets.

So, int (*2Dap) [5]; becomes ( int (*) [5] ) and char * str; becomes just (char *)

Is this a general rule?

As so typedef, your new “type” would be what is your “variable” in your typedef declaration,

eg. typedef double (*twoINoneOUT) (double, double); “twoInoneOUT” would be your new “type”.

Correct??

Just wanted to clarify. I know I’m unlikely to even need to cast these – could save me from having to typedef unnecessarily though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:24:12+00:00Added an answer on May 23, 2026 at 6:24 pm

    I guessing here, the rule is to just strip away the identifier (plus
    the semicolon) of a normal variable declaration and put it in
    brackets.

    Right. This declares a variable called x:

    int (*x)[5];
    

    The type of the variable is int (*)[5], and you could cast to that type using the cast (int (*)[5]).

    As so typedef, your new “type” would be what is your “variable” in
    your typedef declaration,

    Also correct. This declares a type alias called t:

    typedef int (*t)[5];
    

    Syntactically, typedef appears in the same place as a storage class specifier like static.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Should be a simple question, I'm just not familiar with PHP syntax and I
One (dumb) question: Is it possible to use flex 4 syntax declaration inside of
Though i am using Objective-C syntax, the question language agnostic. Assuming the following declaration
according to MSDN the typedef syntax is: typedef type-declaration synonym; Very easy: typedef int
I have a question about the syntax of the Java main declaration: public static
Notice: This question is obsolete; the interface declaration syntax has been removed from Dart:
This is a question about the SYNTAX of c# and NOT about how we
C++11 introduced a new syntax for function declaration, auto func(T rhs, U lhs) ->
I have declared a header file which is giving Syntax error before '{' token.
Can someone explain this method declaration syntax for me? In this function, the number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.