|
But that's not what I wrote. I wanted to return a function pointer from a function named getFunc .
|
|
|
|
|
Greetings and Kind Regards Please permit me to demonstrate the following: By merely following the rules of operator precedence and associativity I deduce the same declaration for getFunc as yourself. I thank Harbison & Steele for teaching me this in their fine C text. Why K&R don't do this is difficult to understand.
// "getFunc is a function which returns a pointer to a function which takes two int args and returns an int"
// getFunc is a function ...
getFunc()
// ... which returns a pointer ...
*getFunc()
// ... to a function which takes two int args ...
*getFunc()(int, int)
(*getFunc())(int, int) // added ()'s because function call (int, int) has higher precedence than indirection *
// ... and returns an int
int (*getFunc())(int, int)
// Voila No Spiral of Death is needed. Best Wishes Cheerios
|
|
|
|
|
It's hard to believe that of all the replies no one has ever read K&R C.
A variable declaration consists of a type and name and possibly a type reference spec such as * or [].
Multiple variable declarations may be combined in a single statement (line) if they are the same type. this is why reference specs go with the name
char *sz, sz2[], sz3[1024];
Types and reference specs can also have modifiers which are can get very confusing with multiple declarations combined on a line.
static const char sz4, *sz5, const *sz6;
Add initializers and you will see why it's pretty standard now days to put one declaration per line.
|
|
|
|
|
Greetings and Kind Regards May I please direct you to my previous post. Cheerios
The Lounge[^]
|
|
|
|
|
C declarations are fine. The problem is in C pointer expressions, where two unfortunate changes were made. First, Ritchie (I presume) chose to make * the pointer dereference operator and either chose or had forced upon him by the * choice the need to make it a *left* unary operator. Had he followed Wirth's prior example in Pascal (using p^ to dereference p), then your backwards issue is automatically solved.
Why? Because C declarators are based on how the variable is used in an expression. So int *p; has the * first because you use *p in an expression to make use of the pointer. The array dimension come after the variable name: int a[5]; because you use a[index] in an expression to access a member of an array.
If the pointer dereference was on the right, then you wouldn't need the quirky -> operator that only exists to cut down on parentheses, where p->member exists only to avoid typing (*p).member.
By the way, the declaration should be "char *p;" instead of the awful "char* p;" that revisionists like to type. The * says that p is a pointer, not that "char" is a pointer. To see the difference, try using:
int* p1, p2; /* this will NOT declare two integer pointers! */
The correct syntax is:
int *p1, *p1;
...since the * says that what's on the right is a pointer.
Again, this misunderstanding wouldn't even come up with a right-unary dereference operator.
Most of the C language is admirable, particularly as a product of the early '70s, but this (along with allowing the <string.h> and parts of <stdio.h> libraries to become de facto standards) get my votes for Dennis Ritchie's biggest mistakes.
|
|
|
|
|
My mother-in-law had problems with the App "VoiceMail" from the german Telekom.
They called the hotline: "Oh, no problem, just deinstall and install it again, everything will work"...
Only that the new Version doesn't run in her phone because that Android version has been discontinued
And they don't offer the old ones... and neither can I find older versions in play store
After googling a bit I have found a site... apkpure.com
It looks like an "internet archive" for android software, they have a a list with almost 40 different past versions of this App and they offer the same for other stuff...
Do you know it / Have you used it??
Is it trustworthy? Or is a risk to get "something else" within the App?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I haven't used it, but ... it looks OK: The 5 Best Sites for Safe Android APK Downloads[^] - the site also lists other sites that may have the APK you wanted.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks.
I have checked both, the signatures are the same in both places and match the downloaded file in both too.
BTW... the link you gave me looks like a nice site too. Do you use it regulary?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
And suddenly I can see this message ... the hamsters have woken up.
It's not one I use often, but it's one of those "hmmm ... bookmark that one" sites you come across from time to time.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Read it properly and explains why: because it's pretty much the only source of installs on Android - 87% of all installs came from the Play Store, with the next highest source being just 5%! So it has a very good threat-to-legitimate app install ratio considering.
I don't have figures for Apple or MS, but I'll guess they are similar or worse. Amazon? I suspect they will be a lot worse.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Of course. There was a bit of cynicism in my post that--I don't blame you for it--didn't come through.
Everyone's making the claim their so-called stores are the only places that can be trusted. Reality shows an entirely different outcome.
|
|
|
|
|
... un plug the computer, Sandra!
|
|
|
|
|
I checked the site with Virus Total. It stated that some 80 plus virus engines all said the site was safe.
Get me coffee and no one gets hurt!
|
|
|
|
|
Thank you. Didn't think of it
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I cut my teeth on a 6502 processor. 8 bit and 65536 bytes of RAM to play with. Later on I moved to 16 and finally 32 bit.
As computers get more sophisticated and accordingly more complicated looking back I realize part of me enjoys them less. Don't get me wrong - garbage collected code is great and not having to worry about out of memory exceptions on a modern OS under most circumstances is a huge win that I think many of us probably take for granted.
I like to bit twiddle though. Don't you? I liked it when I had to come up with something crafty to make it even work. It's a challenge, and it's more hacking than coding.
Recently, I had to change the timing in the driver code for a display I was using because it had never been coded for my IoT CPU.
Even with "higher level" network stuff like REST communication that element of hacking your way through without anything to spare is still there - the other day I had to roll my own HTTP chunked transfer encoding mechanism for batch uploading JSON data from an IoT device, because I didn't have enough RAM to load the logged data into memory so I could generate a Content-Length header for the upload.
All these little skills I picked up coding in the 80s for getting things done without much to work with basically atrophied after years of not only not using them but *avoiding* them.
We're not supposed to hack unless we have to.
We're not supposed to be "clever"
But here we are, full circle, with these little tiny SoC gadgets where it's all necessary again.
And I love it.
Real programmers use butterflies
|
|
|
|
|
I remember those days when oh, if I do this trick I can save one instruction from the loop doing assembly on an 8031 microcontroller. My, I'm clever.
It's your own little medal you can carry around I guess. Ding! Someone just shared a funny meme - gotta go.
|
|
|
|
|
It's not so much for patting myself on the back, although I do like the sense of accomplishment. Really, I enjoy the challenge.
Real programmers use butterflies
|
|
|
|
|
Beats the #$%^& out of crocheting.
|
|
|
|
|
Plus I can't crochet. That is sorcery. I'm more about the witchcraft.
Real programmers use butterflies
|
|
|
|
|
Quote: these little tiny SoC gadgets Ah dangerous stuff: Special Operations Command!
|
|
|
|
|
I think that would be SOC technically.
Real programmers use butterflies
|
|
|
|
|
Yeah its a lot of fun playing with retro devices. I recently built a z80 board and loaded CPM on it. What a rush.
Haven't had to play wit it or any of my other devices lately, been working 4 months solid remodeling a house but nearly done so looking forward to getting back into it.
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
I have a friend who I grew up coding with who is a fan of retrocomputing and I've been trying to pique his interest on IoT gadgets in part because it uses many of the same skills and build useful things with it. Plus there's even money in it.
Real programmers use butterflies
|
|
|
|
|
I got a friend of mine interested in electronics and embedded devices and for about 3 years he feverishly learned and built but then got into ham radios and doesn't do much with it anymore.
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|