aaaa12345
loading
It is a condensed emotional expression of the corporate policy

"Char (* (* F()) ) () " in C Language, What Does It Mean?

This is not a new question. Infact one of the answers on the thread seems to be a blatant copy from stackoverflow1 (as the answer does not quote any references).As Yeshwanth Chintaginjala correctly pointed out , the question is to test your knowledge of operator precedence and associativity.

Inspite of a BNF of 2 page, the language is only limited by your creativity.The problem is very simple. Declaration of function which returns a pointer to array of function pointers.

I have written a sample to actually show a different way of doing the same. At start I also have a commented code which shows declaration of array of function pointers for novice C learners.As Linus Trovals said Talk is cheap, show me the code.

$ cat fpointer.c#include char a() return 'a';char b() return 'b';char c() return 'c';// declare a function pointer to function return char and accepting no argumentstypedef char (*FunctionType)();FunctionType global_f_arr a, b, c;// declare crazinesschar (*(*f()))() return &global_f_arr;// declare saner versiontypedef FunctionType FunctionTypeArray;typedef FunctionTypeArray* FunctionTypeArrayPointer;FunctionTypeArrayPointer SaneF() return &global_f_arr;int main() /* * Example : Single line declaration of a function pointer array * without typedefs * char (*f_arr)() a, b, c; */ FunctionType f_arr a, b, c; printf("Function a: %cn",(f_arr0)()); printf("Function b: %cn",(f_arr1)()); printf("Function c: %cn",(f_arr2)()); printf("Calling function a using craziness: %cn", ((*f())0)()); printf("Calling function b using craziness: %cn", ((*f())1)()); printf("Calling function c using craziness: %cn", ((*f())2)()); printf("Calling function a using sanity: %cn", ((*SaneF())0)()); printf("Calling function b using sanity: %cn", ((*SaneF())1)()); printf("Calling function c using sanity: %cn", ((*SaneF())2)());$ .

/a.outFunction a: aFunction b: bFunction c: cCalling function a using craziness: aCalling function b using craziness: bCalling function c using craziness: cCalling function a using sanity: aCalling function b using sanity: bCalling function c using sanity: cReferences1: What is the meaning of the declaration "char (* ( *f()))();"?2: The syntax of C in Backus-Naur form

· Other Questions

What do the Welsh think of the Welsh language?

Personally, Iu2019m quite 50:50 with Welsh.I like that itu2019s taught, and I like how itu2019s common to be bilingual, and I like how itu2019s more direct (eg u201cBeth gwelaist ti?u201d meaning u201cWhat did you watch?

u201d but literally saying u201cWhat watched you?u201d without all the u2018didu2019 nonsense. Welsh can include humour at times.

). I like being taught Welsh from a very young age, and I like being able to switch language among my peers quite effortlessly. Some words in Welsh are quite humorous.

Popty ping means microwave. Painting is just paintio. Lots of words are similar to that too.

At some point though, it just gets ridiculous.Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.One word, technically.

Itu2019s a place name, but itu2019s still ridiculous. Many Welsh people can pronounce it (Including myself, which I am proud of) however itu2019s just awkward.One thing I do not like, however, is that itu2019s mandatory at GCSE level.

If you donu2019t know what GCSEu2019s are, theyu2019re essentially major exams you do in year 11 (10th grade) and start the coursework for in year 9 or year 10, depending on your school (8th grade/9th grade). These exams determine if you get into Sixth Form (11th and 12th grade) or not.Donu2019t get me wrong, I like the language.

I just donu2019t want it to be forced upon us. Other subjects, you can drop, such as history, German/French/Spanish, ICT, geography, technology, etc. But, Welsh, like science, maths and English, and some others depending on your school, must be taken.

I would happily take the GCSE if it were not forced upon us. Welsh idioms are fun. Rather than u2018Itu2019s raining cats and dogsu2019, itu2019s raining old ladies and sticks.

Rather than u2018Oh my goshu2019 or something similar, pobol bach! (Little people.)TL;DR: Welsh is a nice, but complicated language, with very obscure words and idioms, that we must study age 3u201316 at least.

Note: sorry for any errors, my Welsh is not perfect and I am 13 years old

------

Do blacks sometimes feel that white people ignore them when greeting?

I am not a black person but here goes my experience.I am Indian by ethnicity and moved to the Mid-west(Illinois) to pursue my masters and one of the first things I had to get my head around was that strangers smile at me or say hi, how are you?

. This is NOT a thing in India, it was bizarre to say the least in the beginning, as you may know we are a billion back home and it is a crowded place, if I had to smile and say hi to every stranger passing by, safe to say that I wont get any shit done. It took me a good month or so to acknowledge that this is actually a thing and it took me even more to actually start reciprocating this favor to strangers.

And let me be honest, I used to be at my awkward best for those 2 seconds when we pass by, it never came to me naturally and either I used to fake a smile which was very obvious(I was told lol)or awkwardly try and fail to say hi to the stranger. Most of times it would be something similar from the stranger as well- a fake smile or a how are you? a couple of seconds later that we went past each other.

It dint matter after some time, after one of my co-workers told me that it isnt the same as you go closer to the coasts or big cities, it felt more like an obligation. I still however did try and make an effort to acknowledge some people who do say hi or give a smile genuinely.And heres the thing about the racial thing, after a while I stopped expecting anything genuine from anyone and at the same time did know that there are some genuine people who do have the habit of being pleasant to strangers.

Which made it easier for me since I had low expectations. At the end of the day, who knows what is going on in ones life at that point in time or whats in their time at that very moment- thinking about some test? homework?

how to pay bills? anything is a possibility and more than enough reason to not acknowledge your existence- you being asian, Indian or african american- that is how simple it can be. And ofcourse, theres always sour grapes and rotten eggs, which I think should be left alone.

One thing I have observed in the US is that there is too much overlapping between things, they are polarized in every manner and nothing is simple anymore. I dont know if this is a positive thing but it is certainly a thing. I hope things get to much more simpler state sooner or later.

Just a thought. On a lighter note, my mom visited for my grad walk and I did not give her any headsup about strangers being nice to her and all. She was shit scared that white strangers were being very nice to her for no apparent reason, then on she used to have her head down and walked right by me just to ignore all the suspiciously nice white people.

I had a good laugh and she never got over it even after I explained it to her.

------

What are the best C books?

If you want to know which is the smallest set of books that readably covers everything you need to know about C to be productive, here is my list:1.

Accelerated C - Koenig. If you need a quick all-round introduction)2. Effective C (3/e) - Meyers.

Not yet updated for C11 but still the veritable resource for understanding how C works.3. Effective STL - Meyers.

The book to understand STL nuances.4. C Common Knowledge - Stephen Dewhurst.

Don't know how come this book is not mentioned more often. This is a brilliant book.5.

C Standard Library: Tutorial and Reference Guide (2/e) - Josuttis. Second edition - covers C11 really well. A good reference.

6. C Coding Standards: 101 ways . - Alexandrescu and Sutter.

A very handy book in the tradition of Effective C / C Common Knowledge.7. A Tour of C - Stroustrup.

A short, pithy book you just cannot miss. This is Stroustrup's best work in my opinion. Covers C11.

7. C Concurrency in Action - Williams. C 11 book focusing on the concurrency library.

Big book loaded with information.And some more:8. Modern C Design - Alexandrescu.

This is the "epiphany" book. It makes you realize the power of templates and their use. I would really suggest reading at least the first two chapters of this book to anyone.

If you understand design patterns well, just read on as far as you can.9. Learning Boost C Libraries - Arindam Mukherjee.

Good all-round introduction to Boost - covers smart pointers, containers, strings and regex, various utility classes, I/O, date time, multithreading and concurrent programming, ASIO, metaprogramming, higher-order programming, Spirit libraries, etc.10. Emergent Design - Scott L.

Bain. Not a C book - a Design Patterns applied book, code examples in Java. Thoroughly recommend this book.

11. Head First Design Patterns. Not a big fan of all Head First books but this one kicks some serious ass.

For reference: 12. Design Patterns - Gamma, Helm, Vlissides, Johnson (GoF). Not the most readable of books - I so wish a new edition emerges some day with better examples.

Of course it will no longer be GoF, because Vlissides is no more. But this is the definitive catalog of patterns. Don't read this in isolation.

Vlissides' Pattern Hatching book was a good attempt at that, but it's not widely available.13. The C Programming Language (4/e) - Stroustrup.

This is really if you can handle C literature well already. This book is a marked improvement in terms of readability of the (3/e) and it covers C 11 from the ground up.Online resources: 14.

Stanford Programming Abstractions Series by Julie Zelenski. Don't miss them for anything. - 15.

The Stanford C Course Reader (Page on Stanford) with exercises to boot. Notable omissions: Exceptional C & 15. Exceptional C Style - Sutter.

I feel C Common Knowledge read well will prepare you for the puzzles in these books. Great set of books to understand the ins and outs of a lot of language constructs. But not absolutely necessary to be productive.

Disclaimer: I am the author of one of the books suggested above - Learning Boost C Libraries.

GET IN TOUCH WITH Us
recommended articles
wen
I had a neighbor who had dentures since she was 18. Her own teeth were so crooked and her parents could not afford braces so she had them pulled. She loved her new '...
The suspect in the Pennsylvania police barrack ambush last week was added to the FBI's 10 most wanted list Friday as the search focuses in on the wooded area in the ...
The wiring diagram of single chip microcomputer 80C51 is shown in Figure 1. In Figure 1, position 4 shows the common anode for the tube. Use dynamic display and cycl...
Principle of three-stage dimming of the lamp_How to use TRIAC to dim the LED lamp and how to design the specific scheme? - Programmer SoughtAt present, non-energy-sa...
"To talk about smart grid, Jiangning District has gathered more than 300 enterprises, led by 12 listed enterprises such as NARI Group and Guodian Nanzi, covering the...
What is your policy on bath toys?We only have as many bath toys as can fit in one regular-sized mesh bag on the shower wall. I do not want them taking over the bathr...
Well graphic cards are not cheap, but you will always get ripped by people taking a look at your computer, there's no way around that unless you fix it yourself or h...
No it would not , as a pure black light bulb will not allow the light to come out, and it means it is same when it is on or off. So neither it makes the room lighter...
How to Repair Rain GuttersThis post may contain affiliate links. For more information see our disclosures here . Expert advice on downspout and gutter repairs. Stop ...
(source: Robert Institute of robotics, China)Yaskawa motoman-gp7 is a 6-axis vertical multi joint robot. Because of its combination with the small robot controller "...
no data
ADDRESS
Manhatthan
NY 1234 USA
master@weyes.cn
LINKS
Home
Services
Portfolio
Career
Contact us
PRODUCT
Chandelier
Wall Lamp
Table Lamp
Floor Lamp
Contact Us
+86 020-22139352
If you have a question, please contact at contact service@lifisher.com
Copyright © 2025 | Sitemap
Contact us
whatsapp
phone
email
Contact customer service
Contact us
whatsapp
phone
email
cancel
Customer service
detect