Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Say I have two functions: FILE* get_input(const char fname[static 1]); FILE* get_output(const char fname[static 1]); And I wish to declare a function pointer and assign it the result of some p...
#5: Post edited
- Say I have two functions:
- ```c
- FILE* get_input(const char fname[static 1]);
- FILE* get_output(const char fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
int (*operation)(FILE*, FILE*);- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
- Say I have two functions:
- ```c
- FILE* get_input(const char fname[static 1]);
- FILE* get_output(const char fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
- int foo(FILE *, FILE *);
- int (*operation)(FILE *, FILE *);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
#4: Post edited
- Say I have two functions:
- ```c
- FILE* get_input(const char fname[static 1]);
- FILE* get_output(const char fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
I have:```c- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
- Say I have two functions:
- ```c
- FILE* get_input(const char fname[static 1]);
- FILE* get_output(const char fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
#3: Post edited
- Say I have two functions:
- ```c
FILE* get_input(const char* fname[static 1]);FILE* get_output(const char* fname[static 1]);- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
- I have:
- ```c
- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
- Say I have two functions:
- ```c
- FILE* get_input(const char fname[static 1]);
- FILE* get_output(const char fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
- I have:
- ```c
- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?
#2: Post edited
I have:- ```c
int foo(FILE *, FILE *);- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
Is there any difference between the types of `operation` and `op`? Can I use them interchangably?
- Say I have two functions:
- ```c
- FILE* get_input(const char* fname[static 1]);
- FILE* get_output(const char* fname[static 1]);
- ```
- And I wish to declare a function pointer and assign it the result of some processing which shall be called later.
- Are these two declarations:
- ```c
- I have:
- ```c
- int (*operation)(FILE*, FILE*);
- typeof (foo) *op;
- ```
- equivalent? Or is there any difference between the types of operation and op? If so, how do I properly declare a function pointer with `typeof`?