Thread: Simplify complex declarations using typedef.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2011
    Location
    Athens , Greece
    Posts
    357

    Simplify complex declarations using typedef.

    Hello to all. I have some complex declarations to simplify with typedef I have done a try

    1.
    Code:
     
    char (*x[10]) (int);
    
    /* typedef char FUNC(int);
       typedef FUNC *FUNC_PTR;
       FUNC_PTR x[10]; */
    Why we don't use * symbol in the last statement in front of FUNC_PTR?

    2.
    Code:
     
    int (*x(int))[5]
    I can't do this :/

    3.
    Code:
    float *(*x(void))(int); 
    
    /* typedef float *FUNC(int);
        FUNC *x(void); */
    I have no way to see if I am right could you test my answers? and help me with the second? thank you
    Last edited by Mr.Lnx; 01-02-2014 at 05:39 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 01-01-2014, 03:24 PM
  2. Can someone help me simplify this?
    By Shackdaddy836 in forum C Programming
    Replies: 1
    Last Post: 10-07-2011, 02:56 PM
  3. Replies: 5
    Last Post: 06-26-2008, 05:07 AM
  4. simplify this?
    By markg in forum C Programming
    Replies: 2
    Last Post: 10-25-2005, 08:09 PM
  5. Complex declarations & ?error in Kernighan/Ritchie?
    By zzzaaahhh in forum C Programming
    Replies: 6
    Last Post: 10-04-2004, 04:24 PM